Easy Linux Analogue Composite Video Capture - How to.
Posted: Sat Sep 18, 2010 2:20 pm
Edit...Composite video (with good quality and "in sync" audio) capture in Linux has been somewhat of a holy grail for some time. Try googling for "linux analogue video capture" (which is probably how you got here) or search on youtube, and all you will find are methods that use command line tools. That can be a daunting task, especially for newbies. This method involves NO TYPING, just a copy and paste, followed by a press of the Enter key. The second time you use it you only need to press the "up arrow" key and then the enter key. I will be editing this how to as I learn more and hope it is of use to the Linux community.
Hi, this has been a NIGHTMARE that has taken me FOREVER to get to work. I have tried SEVERAL types of TV/Capture card (pci and usb) and many different distro's and programs (mythtv, mplayer, tvtime etc. etc.) all with no real success. However, today, after many months of trying, I managed to get it working VERY simply
So, to save anyone else the hassle of struggling to get your composite video source (Sky Plus box, Set top box, VCR, Camcorder, Xbox, PS3 etc. etc.) viewable or recorded on your PC please use this guide with my blessing. I am going to list the stuff I did that eventually worked. My system is running an Intel LGA775 board with a (pre-historic) Pentium D dual core processor, 2 GB ram and Mint 9 standard Gnome version, but it should work with any Ubuntu 10.04 based distro or any other distro with similar kernel specs. Kindly post here about the distro you tried with this info, is it working, not working, what you did to make it work etc.
1 Get a Hauppauge PVR-150 pci TV/capture card (I'm sure the other PVR's ie 250, 350, 500 will do the same job but I got a PVR-150) which can be bought on ebay easily enough, (ENSURE YOU GET THE RIGHT ONE FOR YOUR REGIONS TV, ie here in the UK you need a PAL version, there are loads of new ones on eBay that are NTSC so no good to me). These are FULLY supported in Linux AND have a MPEG hardware encoder on board (saving your processor work). I have tried MANY other TV/Capture cards (pci and USB) which cost more money but did not work (ie Video AND audio) for me, save your money and get one of these! Install the card into your PC and check that it is working OK using the dmesg command. Connect your video source to the card using the video and audio connectors. These cards are NOT able to receive Digital (DVB) TV and so are becoming obsolete and therefore cheap! I can now confirm this howto works fine with the PVR-250 card too
2 Use synaptic (Package Manager) to install ivtv-utils, (in some distro's its just ivtv and described as Tools) If you don't have VLC media player installed use synaptic to install that too.
3 In a terminal type (might be a good idea to copy and paste this command) v4l2-ctl -d /dev/video0 -i 2
and press the enter key (note 2 is Composite, 1 is S-video, 0 is TV-tuner)
You will get a reply saying input is now composite. (*note..if you get a card setup error check the dmesg list for missing firmware issues.)
This is the ONLY bit of command line jiggery-pokery/witchcraft you need to do, so you can now close the terminal.
Tip :- The next time you open the terminal just press the up arrow key and the command will magically appear, and you can just press the enter key. If you continue pressing the up arrow all previous commands will appear in the reverse order that you have entered them.
4 Start playing your composite source device, open VLC media player and go to Media/Open Capture Device. In the menu box that opens change the Capture Mode to PVR, change NOTHING else and click play. You should now see and hear (God knows how long it's taken me to get audio ) your composite signal.
5 Right click on the VLC screen and select View/Advanced Controls this will give you a RECORD button (hallelujah) and clicking it will record directly to your home directory (or home/videos etc.) as a mpeg file. Just click record again to stop the recording.
6 There is an option in the VLC Tools/Preferences/Video window to force video aspect ratio, I changed this to 16:9 so everything displays wide screen.
7 Once the file is on your hard drive you can simply play it as is, or load it into Kdenlive (video editor, also available in synaptic) using the Project/Add Clip option, drag it to the time line and edit it. Finally use the render option to save in whatever format you choose. (see note 9 below)
8 The change of input command and the selection of PVR as the source device in VLC will need to be used each time you reboot, I have no idea (yet) of how to make these options permanent.
9 As this card has native mpeg with a resolution of 720 x 576 (4:3 PAL), and no way of knowing via a composite signal if your source is wide screen, your files will try to play in the old 4:3 screen size, you can force the 16:9 option in VLC as stated above and they will play perfectly. If however you want to have them play as a native wide screen file, you can do this in Kdenlive BEFORE editing and rendering. Import the file using the Project/Add Clip option and once the clip is loaded right click on it, and choose Clip Properties/Advanced and check the Force Pixel Aspect Ratio box, and type in 1.42 (that's the recommended setting but if it doesn't look right try different settings). Then drag your clip to the top time line and cut out the bits you don't want (adverts etc.) drag the bits left together and render them using whatever file type you want (you may need to install some un-stripped libraries for some types so see the Kdenlive Forum for info on Kdenlive usage)
Due to problems with lip sync AFTER editing captured files I have started using Avidemux rather than Kdenlive to edit and alter files, see added post below.
Enjoy
Pete
Update, sometimes you might get an issue with firmware files not being loaded/in the wrong place/corrupted, if so you can find them here http://www.ivtvdriver.org/index.php/Firmware just download/extract and put the files where they need to be. That's often lib/firmware and you will need root access.
Hi, this has been a NIGHTMARE that has taken me FOREVER to get to work. I have tried SEVERAL types of TV/Capture card (pci and usb) and many different distro's and programs (mythtv, mplayer, tvtime etc. etc.) all with no real success. However, today, after many months of trying, I managed to get it working VERY simply
So, to save anyone else the hassle of struggling to get your composite video source (Sky Plus box, Set top box, VCR, Camcorder, Xbox, PS3 etc. etc.) viewable or recorded on your PC please use this guide with my blessing. I am going to list the stuff I did that eventually worked. My system is running an Intel LGA775 board with a (pre-historic) Pentium D dual core processor, 2 GB ram and Mint 9 standard Gnome version, but it should work with any Ubuntu 10.04 based distro or any other distro with similar kernel specs. Kindly post here about the distro you tried with this info, is it working, not working, what you did to make it work etc.
1 Get a Hauppauge PVR-150 pci TV/capture card (I'm sure the other PVR's ie 250, 350, 500 will do the same job but I got a PVR-150) which can be bought on ebay easily enough, (ENSURE YOU GET THE RIGHT ONE FOR YOUR REGIONS TV, ie here in the UK you need a PAL version, there are loads of new ones on eBay that are NTSC so no good to me). These are FULLY supported in Linux AND have a MPEG hardware encoder on board (saving your processor work). I have tried MANY other TV/Capture cards (pci and USB) which cost more money but did not work (ie Video AND audio) for me, save your money and get one of these! Install the card into your PC and check that it is working OK using the dmesg command. Connect your video source to the card using the video and audio connectors. These cards are NOT able to receive Digital (DVB) TV and so are becoming obsolete and therefore cheap! I can now confirm this howto works fine with the PVR-250 card too
2 Use synaptic (Package Manager) to install ivtv-utils, (in some distro's its just ivtv and described as Tools) If you don't have VLC media player installed use synaptic to install that too.
3 In a terminal type (might be a good idea to copy and paste this command) v4l2-ctl -d /dev/video0 -i 2
and press the enter key (note 2 is Composite, 1 is S-video, 0 is TV-tuner)
You will get a reply saying input is now composite. (*note..if you get a card setup error check the dmesg list for missing firmware issues.)
This is the ONLY bit of command line jiggery-pokery/witchcraft you need to do, so you can now close the terminal.
Tip :- The next time you open the terminal just press the up arrow key and the command will magically appear, and you can just press the enter key. If you continue pressing the up arrow all previous commands will appear in the reverse order that you have entered them.
4 Start playing your composite source device, open VLC media player and go to Media/Open Capture Device. In the menu box that opens change the Capture Mode to PVR, change NOTHING else and click play. You should now see and hear (God knows how long it's taken me to get audio ) your composite signal.
5 Right click on the VLC screen and select View/Advanced Controls this will give you a RECORD button (hallelujah) and clicking it will record directly to your home directory (or home/videos etc.) as a mpeg file. Just click record again to stop the recording.
6 There is an option in the VLC Tools/Preferences/Video window to force video aspect ratio, I changed this to 16:9 so everything displays wide screen.
7 Once the file is on your hard drive you can simply play it as is, or load it into Kdenlive (video editor, also available in synaptic) using the Project/Add Clip option, drag it to the time line and edit it. Finally use the render option to save in whatever format you choose. (see note 9 below)
8 The change of input command and the selection of PVR as the source device in VLC will need to be used each time you reboot, I have no idea (yet) of how to make these options permanent.
9 As this card has native mpeg with a resolution of 720 x 576 (4:3 PAL), and no way of knowing via a composite signal if your source is wide screen, your files will try to play in the old 4:3 screen size, you can force the 16:9 option in VLC as stated above and they will play perfectly. If however you want to have them play as a native wide screen file, you can do this in Kdenlive BEFORE editing and rendering. Import the file using the Project/Add Clip option and once the clip is loaded right click on it, and choose Clip Properties/Advanced and check the Force Pixel Aspect Ratio box, and type in 1.42 (that's the recommended setting but if it doesn't look right try different settings). Then drag your clip to the top time line and cut out the bits you don't want (adverts etc.) drag the bits left together and render them using whatever file type you want (you may need to install some un-stripped libraries for some types so see the Kdenlive Forum for info on Kdenlive usage)
Due to problems with lip sync AFTER editing captured files I have started using Avidemux rather than Kdenlive to edit and alter files, see added post below.
Enjoy
Pete
Update, sometimes you might get an issue with firmware files not being loaded/in the wrong place/corrupted, if so you can find them here http://www.ivtvdriver.org/index.php/Firmware just download/extract and put the files where they need to be. That's often lib/firmware and you will need root access.