VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors.
Please consider supporting us by disabling your ad blocker or buy PlayOn and record Netflix! :)
+ Reply to Thread
Results 1 to 26 of 26
Thread
  1. Member
    Join Date
    Oct 2005
    Location
    Rochdale, United Kingdom
    Search Comp PM
    Converting VHS to DVD under Linux HOWTO

    by Dan MacDonald, 24th August 2006

    This document assumes you have:

    A computer with a fast CPU (2Ghz+ if you want to encode straight to MPEG2 in software with no dropped frames) running Linux with at least 10GB free drive space.

    Basic knowledge of Linux (how to install programs, use the console etc.)

    A VCR

    A video capture card supported by Linux (see http://linuxtv.org/v4lwiki/index.php/Main_Page )

    A DVD burner

    The programs tvtime, varsha, k3b and mencoder (which is part of mplayer)

    You may also need a SCART to COMPOSITE cable and a stereo RCA to 3.5mm jack audio cable

    The best way to capture analogue video under any operating system is with a firewire analogue video adapter such as Canopus ADVC 110. This supposedly gives much better picture quality than most of the PCI capture cards but these adapters are still quite expensive at the time of writing. If you plan to do a lot of analogue video capture then it may well be worth the extra cost. Under linux you could then just use dvgrab to capture from one of these but I'm not covering that method here.

    The first step, of course, is to connect your VCR to your PC. Most TV capture cards have three types of video input: s-video, composite (the yellow one) and TV aerial. s-video gives the best quality of the three so use that if you can. I have an Avermedia TV Capture 98 PCI capture card which is based on the bt878 chipset. The picture I get with this card is quite grainy and I hear that the saa713x chipset capture cards are supposed to be much better- see the v4l2 wiki link above for card recommendations and compatibility. Another thing about this card is that I couldn't get it to find my VCR signal through the aerial connector and so I had to use a SCART to composite cable.

    After plugging your VCR into your PC (including running an auxiliary cable from your VCRs sound outputs to your PCs mic in) insert a VHS tape, push play and start tvtime to check you are getting a picture and sound. If you are trying to get a picture through an aerial cable then you will probably have to scan through the channels but this isn't normally neccessary with composite and s-video. If there is no sound then you will need to open your mixer program (like alsamixer) and turn up the mic input levels.

    From here on I'll be talking about using tvtime but if you have xdtv (xawdecode) installed you can use that instead to preview your analogue video input. I'm using mencoder here as I haven't yet worked out the exact settings to capture directly to a DVD-compliant MPEG2-PS file using xdtv, which would be a much nicer way of doing things for GUI fans. Also, if your computer isn't fast enough to be encoding direct to DVD res MPEG2 under mencoder then you'd be better off capturing your footage under xdtv to a MJPEG format avi file. MJPEG avis can be loaded into both Cinelerra and DeVeDe.

    Once you have a picture with sound under tvtime then you are ready to start capturing. If your tape is at the right point then you can shut tvtime now. Open up a console, change into the directory where you want to save your video (you will need a few GB free if you're doing a full tape) and then copy/paste one of the following three commands into that console

    PAL LOW (VCD QUALITY) RES CAPTURE

    mencoder -tv norm=PAL:driver=v4l2:width=352:height=288:input=1: fps=25 tv:// -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd -vf pp=lb/ha/va/dr,hqdn3d,harddup -srate 48000 -af lavcresample=48000 -lavcopts vcodec=mpeg2video:vrc_buf_size=900:vrc_maxrate=150 0:vbitrate=1300:keyint=15:acodec=mp2:abitrate=192: aspect=4/3 -o capture.mpg

    PAL MEDIUM (SVCD QUALITY) RES CAPTURE

    mencoder -tv norm=PAL:driver=v4l2:width=352:height=576:input=1: fps=25 tv:// -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd -vf pp=lb/ha/va/dr,hqdn3d,harddup -srate 48000 -af lavcresample=48000 -lavcopts vcodec=mpeg2video:vrc_buf_size=1500:vrc_maxrate=30 00:vbitrate=2500:keyint=15:acodec=mp2:abitrate=192 :aspect=4/3 -o capture.mpg

    PAL HIGH ('DVD' QUALITY) RES CAPTURE

    mencoder -tv norm=PAL:driver=v4l2:width=720:height=576:input=1: fps=25 tv:// -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd -vf pp=lb/ha/va/dr,hqdn3d,harddup -srate 48000 -af lavcresample=48000 -lavcopts vcodec=mpeg2video:vrc_buf_size=1500:vrc_maxrate=80 00:vbitrate=7000:keyint=15:acodec=mp2:abitrate=192 :aspect=4/3 -o capture.mpg

    As soon as you push enter the capture process will begin, to end it push CTRL+C.

    It is important to note that the above commands are for capturing PAL (European) video from a composite input. If you use NTSC videos (like in America and Japan) then you have to change the norm value to ntsc, the fps value to 29.97 and you would use these width/height values instead:

    720 x 480 high res

    352 x 480 medium res

    352 x 240 for low res

    If you're capturing through the aerial, change the input value to 0 (or 2 for s-video).

    '-vf pp=lb/ha/va/dr,hqdn3d,harddup' is the video filter setting to clean up a grainy picture. If you have a better quality capture card than me then you should be able to get away with just '-vf harddup' instead. Using fewer filters will mean less stress on your CPU of course.

    The main value you may be interested in altering is vbitrate. You can lower the bitrate to shrink the size of the video file and fit more video onto your DVD but this of course also degrades the quality and puts greater strain on the CPU when encoding. Don't expect all DVD players to be able to handle a vbitrate greater than 8000 though.

    On my AthlonXP 2000 (which is of course really 1.7Ghz) I can capture a full 25fps @ 352x576 with stereo sound and no dropped frames on certain footage but if there is lots of motion it tends to average about 20fps which is also the framerate it maxes out capturing at the high res setting.

    Now that you have an .mpg file of your video you should try playing it under mplayer or xine to check that it is OK. If its fine then you can load varsha and create a DVD iso file with it which in turn can be burned with the burning program of your choice such as k3b.

    If you want to know more about mencoder's options then you should read the manpage or the online documentation at

    http://www.mplayerhq.hu/DOCS/HTML-single/en/MPlayer.html

    Good luck!

    dan
    Quote Quote  
  2. Member tekkieman's Avatar
    Join Date
    Mar 2004
    Location
    Over the hill
    Search Comp PM
    Thank you for this great info. I will use this as a guide and test it sometime soon. My capture card is also a BT878 chipset, so I hope for good results. I just happen to have a bunch of Hi-8 I need to capture sometime in the very near future.
    Quote Quote  
  3. Member
    Join Date
    Oct 2005
    Location
    Rochdale, United Kingdom
    Search Comp PM
    np tekkieman! Its good to know I've already saved at least one person potentially days of hassle and experimentation like I went through.

    As you can see, the process I described above is entirely graphical, point+click apart from the actual capture part. Before being forced into figuring out that mencoder command I tried a few different mencoder GUIs but none of them worked, at least not for doing what I wanted. It would be good if tvtime could integrate capture features.

    If anyone knows of a nice mencoder GUI for Linux that can capture from a v4l device to DVD MPEG2 (and VCD MPEG too pref.) that WORKS then please let me know!

    Thanks!
    Quote Quote  
  4. Member
    Join Date
    Oct 2005
    Location
    Rochdale, United Kingdom
    Search Comp PM
    I just edited the above HOWTO to reflect that you probably need a 2Ghz+ CPU if you want to record straight to DVD MPEG2 without dropping any frames under most conditions.

    There is a graphical analogue video capture tool for Linux that works (a bit) - gv4l, but it uses transcode not mencoder . If I use its ffmjpeg codec and turn the de-interlace option on I get smooth, fantastic image quality captures at up to 720x576- the problem is that the sound is out of sync. I've read that this could be because it is compressing the audio so I've tried using 'ffmjpeg,wav' 'ffmjpeg,raw' or 'ffmjpeg,pcm' in the 'encode codec' box as I read somewhere but that doesn't work so I've wrote to the programs author to see if he can help.

    I'd really like to get this sorted as this would seem to be the best option for transferring some analogue video to DVD under Linux for people like me whose CPU isn't quite fast enough for real-time MPEG2 encoding. Soon as I we get this sorted out I'll update this HOWTO with a second method with 2 encoding steps (gv4l -> DeVeDe) instead of one.
    Quote Quote  
  5. Member
    Join Date
    Apr 2003
    Location
    United States
    Search Comp PM
    This is the same problem I had with gv4l. Audio out of sync. After weeks & week of trying everything writing the author (I did get a respose) I still couldn't get it to work correctly.

    I finally gave up on it. I then bought a PVR-250 card & did a dual boot with KnoppixMyth.
    I capture directly to DVD format with no dropped frames at a full 720x480 even accross a network.

    Now When I need to capture any video I reboot in KnoppixMyth and do my capture.
    Quote Quote  
  6. Member
    Join Date
    Oct 2005
    Location
    Rochdale, United Kingdom
    Search Comp PM
    Great news - I found it!!!

    Yes, there is a graphical analogue video capture tool for Linux that really DOES work, its called

    xdtv

    which is short for xawdecode. As you might guess from the name, it is basically a souped-up XawTV with many more options for video capture. I find it strange that xdtv is five years old now but not one of the hundreds of web sites, forums and documents about Linux video capture that I read mentioned this program. Hundreds (thousands) of people have read this guide in the last few days and it would seem none of those people knew about it either. The other strange thing about this is how I found it- under the Multimedia/Video section of kde-apps.org and it is obviously neither a QT or KDE app!

    I'm happy with my Linux video setup now as xdtv can capture perfect quality 704x576 MPEG2 or MJPEG video @25fps on my AthlonXP with NO frames dropped- yeah! I now just need to see if I can get it to produce DVD compliant MPEG2 files...
    Quote Quote  
  7. Member
    Join Date
    Oct 2005
    Location
    United States
    Search Comp PM
    Thanks for the guide. My only comment is that capturing straight to mpeg will make the video tougher to edit, if you want to remove commercials, or extra stuff you don't want. (many editors botch the a/v sync with mpegs)

    If you capture to something other than mpeg, then you can do it on a slower machine too

    For capturing, I use mjpeg tools:

    http://mjpeg.sourceforge.net/

    It comes with a lavrec command that can be used to capture video to an avi. It can then be edited with the included glav tool or with something like avidemux.

    mjpeg tools also comes with tools to convert to MPEG, and various filters, but I find mencoder is faster for this task.

    I've tried various programs for this task, and the above is what works best for me so far.
    Quote Quote  
  8. Member oldcpu's Avatar
    Join Date
    Aug 2005
    Location
    Europe
    Search Comp PM
    Originally Posted by uth
    Thanks for the guide. My only comment is that capturing straight to mpeg will make the video tougher to edit, if you want to remove commercials, or extra stuff you don't want. (many editors botch the a/v sync with mpegs)
    I used to find this too, but my experience with dvbcut (which I mentioned in another thread on this subject) has been that it does truely an excellent job of retaining audio-video sync. Do you experience problems with it also?
    Quote Quote  
  9. Member
    Join Date
    Oct 2005
    Location
    Rochdale, United Kingdom
    Search Comp PM
    I couldn't get either lavrec or glav to work but I agree that MJPEG would be a better choice of capture format if you wanted to edit too. In fact thats the format I've been capturing to under xdtv before I use DeVeDe to make a DVD image out of the avis. I can confirm that MJPEG avi's captured with xdtv open fine under Cinelerra

    I wrote to both the author and mailinglist for xdtv asking if anyone knew the correct capture settings to record to a DVD compliant MPEG2-PS file but I've had no response. The plan was to re-write this tutorial based around xdtv but looks like that will have to wait until someone does some experimentation to discover the correct settings.

    It looks like xdtv/ xawdecode still hasn't been added to the list of Linux video tools yet- might have to write another mail to the maintainers as I think its an important addition/ big omission.
    Quote Quote  
  10. Member
    Join Date
    Sep 2006
    Location
    Italy
    Search Comp PM
    I just wanted to say that mpegs created with mencoder the way presented in this thread, are almost ok to be imported in mainactor.

    There are only some "minor" problems which I reported in an unofficial mainactor forum.

    http://mainactor.flavor8.com/index.php?topic=25.msg44#msg44

    and thanks for this howto
    Quote Quote  
  11. Member
    Join Date
    Oct 2005
    Location
    Rochdale, United Kingdom
    Search Comp PM
    I made a small update to this document today just to explain why I'm using mencoder and tvtime instead of replacing them both with just xdtv
    Quote Quote  
  12. Banned
    Join Date
    Dec 2006
    Location
    US
    Search Comp PM
    visit SPAM and transfer your home video tapes to dvd. You can get a pretty good conversion at a reasonable price from a lot of places. But what are most of these companies lacking? Care and attention to detail! Other ways you get totally amateurish product done with domestic equipment.[/url]
    Quote Quote  
  13. Member
    Join Date
    Feb 2007
    Location
    United States
    Search Comp PM
    Okay,

    danboid said you need to install "the programs tvtime, varsha, k3b and mencoder (which is part of mplayer)" in order to capture VHS onto DVD media. The hardware is set up and I've been converting these tapes to DVD in Windows but I want to do it in linux.

    Having trouble getting off the ground here. Via synapitc package manager I installed all the programs danboid suggested in my Ubuntu 6.06 system with a SAA7134 based video capture card. Varsha don't even show up in the Applications menu. TVtime does show up, however, but when I click on the menu icon, TVtime doesn't load. Danboid says the starting point is getting a signal in TVtime. Well, I can't even get TVtime to open. Can anyone help?

    Thanks, Steve
    Quote Quote  
  14. Member
    Join Date
    Apr 2007
    Location
    Italy
    Search Comp PM
    Hi Danboid,

    I have used mencoder in the way you described; the video quality it's pretty good, but the audio gives me some problem of noise. To give you an idea of this, it is similar to a mp3 with a very low bitrate.
    Which option of mencoder must I modify ?

    Thank you so much
    Quote Quote  
  15. Member
    Join Date
    Apr 2007
    Location
    Italy
    Search Comp PM
    I have solved this audio noise problem, adding: alsa:audiorate=128000

    Thanks however!
    Quote Quote  
  16. Member
    Join Date
    Jun 2007
    Location
    Australia
    Search Comp PM
    It is important to note that the above commands are for capturing PAL (European) video from a composite input
    Is there any diffrence in PAL (Australian) fps. I have tried to copy using the commands but am getting poor picture quality.
    Quote Quote  
  17. Member
    Join Date
    Oct 2008
    Location
    United Kingdom
    Search Comp PM
    I found this HowTo really helpful. The only problem I've had is that I couldn't record audio. I'm using a Hauppauge ImpactVCB capture board, and feeding the audio into the Line In jack on my motherboard, and I'm running Fedora 9.

    The problem was that the alsa mixer wasn't set to capture from Line In. Entering

    amixer -c 0 sset Line cap

    solved it.

    Thanks.
    Quote Quote  
  18. Member
    Join Date
    Mar 2010
    Location
    Great Britain
    Search PM
    I've just tried an adapted mencoder command. The screen is black on mplayer & vlc playback of capture.mpg. There seem to be a lot of frame drops even though the summary says that 0 dropped: particularly if I let mencoder run for a minute. Terminal output attached. Help please!
    Quote Quote  
  19. Member
    Join Date
    Mar 2010
    Location
    Great Britain
    Search PM
    Very strange - I uploaded the terminal listing but it didn't show against the message. Now it shows.
    Image Attached Files
    Quote Quote  
  20. Originally Posted by johnaaronrose View Post
    Very strange - I uploaded the terminal listing but it didn't show against the message. Now it shows.
    Too much dropped frames.. I assume the process takes more than 60% CPU Try using -ovc copy -oac copy... After capture you will get a HUGE video. All that you need to do is recode it and delete the original HUGE capture video file.
    Quote Quote  
  21. https://forum.videohelp.com/threads/355880-Tutorial-Video-capturing-VHS-using-Linux-%28...-VLC-player%29

    Here is a different method which is much easier, of doing video capture with Linux. (Not using a firewire cable, though).
    Quote Quote  
  22. I have some big problems
    My cpu is faster enough,i think is a x4 965 amd at 3400mhz,i use a bttv card
    Hauppage WinTV Impact VCB PAL-/NTSC
    This card doesn't had sound input so i use my soundcard (amd integrated pci soundcard)
    for sound and card for video.
    Picture is ok,but audio is out of sync,i lost(on mpeg2 raw capture) more than 160 frames on 1:40:00
    vhs.
    I have to change card or there is a solution?
    I try
    gst = works only the theora ogg,and quality is bad
    mencoder = quality good,but audio out of sync,i try mpeg2 raw,avi-yuv raw,lavc
    and a lot of options (noskip,mc 0)
    Please help me,thanks
    Quote Quote  
  23. Member
    Join Date
    Mar 2011
    Location
    Nova Scotia, Canada
    Search Comp PM
    Originally Posted by heyheyhey View Post
    I have some big problems
    My cpu is faster enough,i think is a x4 965 amd at 3400mhz,i use a bttv card
    Hauppage WinTV Impact VCB PAL-/NTSC
    This card doesn't had sound input so i use my soundcard (amd integrated pci soundcard)
    for sound and card for video.
    Picture is ok,but audio is out of sync,i lost(on mpeg2 raw capture) more than 160 frames on 1:40:00
    vhs.
    I have to change card or there is a solution?
    I don't know, but you should try the support forum for your linux distro for hardware questions.

    gst = works only the theora ogg,and quality is bad
    mencoder = quality good,but audio out of sync,i try mpeg2 raw,avi-yuv raw,lavc
    and a lot of options (noskip,mc 0)
    Please help me,thanks
    It's hard to say ... you don't specify which linux distro/version you're using.

    It does sound like you don't have enough codecs installed. Some linux distros come with pretty much everything and some have nothing that's not free open source. Which is what this sounds like. Gst is gstgreamer, and it definitely can support more than ogg codecs.

    There will be one or more packages to install with the codec libraries you need. Not knowing the distro and desktop version I can't say.

    Your best option is your distro support site(s).
    Quote Quote  
  24. Originally Posted by Hoser Rob View Post
    Originally Posted by heyheyhey View Post
    I have some big problems
    My cpu is faster enough,i think is a x4 965 amd at 3400mhz,i use a bttv card
    Hauppage WinTV Impact VCB PAL-/NTSC
    This card doesn't had sound input so i use my soundcard (amd integrated pci soundcard)
    for sound and card for video.
    Picture is ok,but audio is out of sync,i lost(on mpeg2 raw capture) more than 160 frames on 1:40:00
    vhs.
    I have to change card or there is a solution?
    I don't know, but you should try the support forum for your linux distro for hardware questions.

    gst = works only the theora ogg,and quality is bad
    mencoder = quality good,but audio out of sync,i try mpeg2 raw,avi-yuv raw,lavc
    and a lot of options (noskip,mc 0)
    Please help me,thanks
    It's hard to say ... you don't specify which linux distro/version you're using.

    It does sound like you don't have enough codecs installed. Some linux distros come with pretty much everything and some have nothing that's not free open source. Which is what this sounds like. Gst is gstgreamer, and it definitely can support more than ogg codecs.

    There will be one or more packages to install with the codec libraries you need. Not knowing the distro and desktop version I can't say.

    Your best option is your distro support site(s).
    I use slackware,i have many codecs

    Code:
    /var/log/packages/gst-ffmpeg-0.10.13-x86_64-3sl
    /var/log/packages/gst-plugins-bad-0.10.23-x86_64-3_SBo
    /var/log/packages/gst-plugins-base-0.10.36-x86_64-2
    /var/log/packages/gst-plugins-base-compat32-0.10.36-x86_64-2compat32
    /var/log/packages/gst-plugins-good-0.10.31-x86_64-5
    /var/log/packages/gst-plugins-good-compat32-0.10.31-x86_64-5compat32
    /var/log/packages/gst-plugins-ugly-0.10.19-x86_64-1sl
    /var/log/packages/gst-python-0.10.22-x86_64-2sl
    /var/log/packages/gstreamer-0.10.36-x86_64-2
    /var/log/packages/gstreamer-compat32-0.10.36-x86_64-2compat32
    /var/log/packages/lame-3.99.5-x86_64-2sl
    /var/log/packages/ffmpeg-2.1.3-x86_64-1sl
    /var/log/packages/libmpeg2-0.5.1-x86_64-6sl
    /var/log/packages/smpeg-r399-x86_64-2sl
    /var/log/packages/a52dec-0.7.4-x86_64-3sl
    Quote Quote  
  25. I use now a semipro VCR and usb card(grabby) with this line

    Code:
    mencoder -tv driver=v4l2:device=/dev/video1:input=1:width=720:height=576:alsa:adevice=hw.2,0:amode=1:immediatemode=0:amode=1:audiorate=48000:forceaudio:fps=25 -oac lavc -ovc lavc -mpegopts format=dvd:tsaf -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=15:aspect=4/3:vstrict=0:acodec=mp2:abitrate=384 -vf yadif,softskip,hqdn3d,harddup -mc 0 -noskip -o output.mpg -of mpeg tv://
    Audio is onsync
    Did you suggest to use norm=PAL or leave it as is?
    Quote Quote  
  26. Solution found: changing from usb to pci card
    i use this



    Works really good,only 2 frame lost
    audio sync 100% perfect
    Quote Quote  



Similar Threads