10.1. TV input

Chapter 10. TV

10.1. TV input

This section is about how to enable watching/grabbing from V4L compatible TV tuner. See the man page for a description of TV options and keyboard controls.

10.1.1. Compilation

  1. First, you have to recompile. ./configure will autodetect kernel headers of v4l stuff and the existence of /dev/video* entries. If they exist, TV support will be built (see the output of ./configure).

  2. Make sure your tuner works with another TV software in Linux, for example XawTV.

10.1.2. Usage tips

The full listing of the options is available on the manual page. Here are just a few tips:

10.1.3. Examples

Dummy output, to AAlib :)

mplayer -tv driver=dummy:width=640:height=480 -vo aa tv://

Input from standard V4L:

mplayer -tv driver=v4l:width=640:height=480:outfmt=i420 -vc rawi420 -vo xv tv://

A more sophisticated example. This makes MEncoder capture the full PAL image, crop the margins, and deinterlace the picture using a linear blend algorithm. is compressed with a constant bitrate of 64kbps, using LAME codec. This setup is suitable for capturing movies.

mencoder -tv driver=v4l:width=768:height=576 -oac mp3lame -lameopts cbr:br=64\
 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=900 \
 -vf crop=720:544:24:16,pp=lb -o output.avi tv://

This will additionally rescale the image to 384x288 and compresses the video with the of 350kbps in high quality mode. The vqmax option looses the quantizer and allows the video compressor to actually reach so low even at the expense of the quality. This can be used for capturing long TV series, where the video quality isn't so important.

mencoder -tv driver=v4l:width=768:height=576 \
 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=350:vhq:vqmax=31:keyint=300 \
 -oac mp3lame -lameopts cbr:br=48 -sws  -o output.avi\
 -vf crop=720:540:24:18,pp=lb,scale=384:288 tv://

It's also possible to specify smaller image dimensions in the -tv option and omit the software scaling but this approach uses the maximum available information and is a little more resistant to noise. The bt8x8 chips can do the averaging only in the horizontal direction due to a hardware limitation.


Chapter 10. TV 10.2. Teletext