bttv: driver version 0.7.104 loaded
bttv: using 4 buffers with 2080k (8320k total) for capture
bttv: Host bridge is PCI device 10de:01e0 (nVidia Corporation)
bttv: Bt8xx card found (0).
bttv0: Bt878 (rev 17) at 01:09.0, irq: 10, latency: 32, mmio: 0xe5000000
bttv0: detected: Leadtek WinFast TV 2000 [card=34], PCI subsystem ID is 107d:6606
bttv0: using: BT878(Leadtek WinFast 2000/ W) [card=34,insmod option]
i2c-core.o: adapter bt848 #0 registered as adapter 0.
Now, the V4L backend is up and running, so now you need a frontend. Most
people talk about XawTV like it's the only game in town, but Linux is
all about choice, and I prefer to use
mplayer, so the next part of the guide will tell you how to use it
for your TV viewing and capturing needs.
First off, you should install LAME. MPlayer can use it to encode captured audio in MP3 format. Most distributions include a precompiled package, otherwise it's just ./configure && make && make install.
Then, download the latest release of MPlayer, extract it, and enter its directory. You might also want to download the win32, quicktime, xanim and realvideo codecs, and put them somewhere convenient. I use
/usr/share/mplayer/codecs. I'll assume you've done this.
MPlayer is now ready to go. Now, the only issue that remains is that the command to run mplayer with V4L is a little cryptic. Here are some
examples:
mplayer -tv driver=v4l:norm=ntsc:input=1:width=352:height=240 -double
-vo sdl tv://
This captures video from the video-in jack on the card (input=1) at a resolution of 352x240, in NTSC format, and outputs it with double buffering using SDL.
mplayer -tv driver=v4l:norm=ntsc:channel=3:chanlist=us-cable:width=352:height=240
tv://
This tunes to North American (chanlist=us-cable) TV channel 3, and outputs it using plain old X video.
mplayer -tv driver=v4l:norm=ntsc:input=1:width=640:height=480 -double -vf lavcdeint -vo sdl tv://
Video-in jack, 640x480 resolution, double buffering, libavcodec de-interlace filter (-vf lavcdeint), SDL output.
If all has gone well, you are now watching TV on Linux. Now, you're probably wondering how to capture to a file. MEncoder, which comes with MPlayer, can capture and encode video in real-time and output it to an AVI file. Here is an example:
mencoder -oac mp3lame -ovc lavc -lameopts mode=1:vbr=2:q=4 -lavcopts vcodec=mpeg4 -tv driver=v4l:norm=ntsc:input=1:adevice=/dev/dsp:width=352:height=240
-af volume=-15 -o tv.avi tv://
Capture video from video-in jack on TV card at 352x240, and audio from the sound card (adevice=/dev/dsp)
Scale the audio by -15 dB (-af volume=-15)
Encode audio in MP3 format (-oac mp3lame), with settings (-lameopts):
joint stereo (mode=1), default VBR method (vbr=2), pretty high VBR quality (q=4)
Encode video using libavcodec (-ovc lavc), using a DivX-like MPEG-4 codec (-lavcopts vcodec=mpeg4)
Output to tv.avi in the current directory.
Note that, using this method, MEncoder will only capture sound from the audio channel you have selected as the recording source. In this case, you almost certainly want to set that to Line, using whatever mixer app you prefer. If the sound in the output file is too quiet, either set the -af volume parameter a little higher, or remove it. If it's too loud, set it lower.
As always, refer to the man page for specific details. This guide should be enough to get you started though. Enjoy.
November 20, 2009
November 19, 2009