You've got a bunch of video tapes and a camcorder that is getting old. Before the camcorder breaks you want to make DVDs from the tape source. You can
This tutorial addresses the second option. The Linux method should lead to higher quality results because you can use digital filtering and a better quality mpeg encoder. For reference, filtering and encoding takes about 10 hours for two hours of video on a PIII server with dual 650Mhz CPUs.
Note that home made DVDs are significantly less durable than factory made disks. The data on a recordable DVD is stored by means of a laser reactive dye that can fade over time. Different blank media use different dyes with different aging characteristics. There have been a number of reports of recordable DVDs that are not playable after only 2 to 5 years. For best results use achival quality DVDs, don't write on them with permanent markers and follow the NIST guildelines on Care and Handling of CDs and DVDs.
Keep the old tapes. In 20 years it is not obvious which format will still be playable. Additional information on archiving video may be found at How to Archive AVCHD Video.
There are a number of ways to get the video into the computer. One way is to use the passthrough feature of a miniDV camcorder or the digital output of a Sony Digital 8 camcorder to convert the Hi8 source to DV which is then sent via firewire to the computer. This yields a workflow identical to transferring miniDV tapes to DVDs. The main drawback of this method is that the 4:1:1 colorspace of the DV format has to be converted to the 4:2:0 colorspace of the DVD format which results in further reducing your color resolution.
Another way to capture the Hi8 tape is a hardware mpeg2 encoder. This will result in video quality similar to a DVD recorder. Since the capture is already mpeg format, it can be written directly to the DVD without additional encoding. Remultiplexing may be necessary. In this case use avidemux2_gtk in copy mode to create a DVD PS format file. Now skip down to Making the Chapters below.
I generally use an analog video capture card to tranfer my Hi8 tapes into the computer. The capture is stored in a high bandwidth intermediate format, then digitally filtered and encoded using a high quality software mpeg encoder. Note that the digital filtering improves the encoding quality of analog sources, but is too slow to do during video capture.
I use a dual processor PIII 650Mhz system and a video capture card based on the Philips saa7134 chipset. Connect your camcorder with S-video if possible; otherwise, use composite video. Then plug the camcorder sound output into the line-input of the sound card.
Use aumix to set the sound recording gain on the sound card. The VU meters in audacity work for this, though I usually use the ones built into Cinelerra. Close audacity and use xawtv to tune in the video on the video capture card. Then close xawtv.
Use streamer to capture the video. This program is multi-threaded and is the only option on a dual processor PIII 650Mhz system that doesn't drop frames. A suitable command line is
$ streamer -q -p3 -b64 -iS-Video -nntsc \ -r29.97 -s640x480 -fjpeg -j85 \ -Fstereo -t2:05:00 -o video.mov
Note that I've chosen to use three threads even though there are only 2 CPUs in the system. If you have a single CPU you may want to use -p2 or -p1 instead. If your machine and video capture card supports it you may specify -s720x480 so there is no rescaling during the final encoding. The capture will end after running for 2 hours and 5 minutes, slightly longer than the length of a full Hi8 tape.
The video.mov file needs to be encoded into an mpeg file. This can be done with ffmpeg, mjpegtools or mencoder. I think that mpeg2enc from mjpegtools gives the best results. Since this is an analog video source, it is important to filter it. Filtering combined with multi-pass variable-bit-rate software encoding yields better quality video than obtained with a DVD recorder or hardware mpeg2 encoder.
Don't deinterlace. That throws away half the video signal. The only reason to deinterlace when archiving a tape is to save space. For example, if you are compressing 4 hours of video to fit onto a single layer DVD. Interlaced video looks awful on a computer screen, but works fine on a standard DVD player connected to a television.
Make sure you have the interlacing order correct. The choices are top field first or bottom field first. My experience has been that DV video is interlaced bottom field first and nearly everything else is top field first. A procedure for determining the interlacing order is given in Checking Interlacing Flags with Linux. Commands to encode source that is interlaced top field first are
$ lav2wav video.mov >video.wav $ sox -V video.wav -r48000 video-48.wav $ toolame -b 224 -s48 video-48.wav video.m2a $ lav2yuv video.mov | yuvcorrect -T INTERLACED_TOP_FIRST | yuvscaler -nn -O SIZE_704x480 | yuvdenoise -g 0,0,0 -t 8,12,12 -M 0,0,0 | mpeg2enc -M0 -nn -a2 -f8 -G18 -b7000 \ -V230 -q8 -o video.m2v $ mplex -f8 video.m2v video.m2a -o video.mpg
To encode source that is interlaced bottom field first, replace INTERLACED_TOP_FIRST in the above set of commands by INTERLACED_BOTTOM_FIRST. Also, if your source in 720x480 rather than 640x480 or 704x480 then set the yuvscaler output to -O DVD.
Occasionally there is a error in the variable bitrate control in mpeg2enc that leads to a buffer underflow which is detected during the multiplexing stage. If there are more than 10 such underflows, then mplex will abort with an error.
Buffer underflows cause a DVD to stutter and pause during playback; however, there are times when it is appropriate to ignore buffer underflows and multiplex the files anyway. For example, older camcorders will play the unrecorded parts of a tape as random noise or snow. Random noise is difficult to compress and may cause a buffer underflow. To multiplex a video stream with multiple buffer underflows use the command
$ mencoder video.m2v -audiofile video.m2a \ -oac copy -ovc copy -of mpeg \ -mpegopts format=dvd:tsaf:vaspect=4/3 -o video.mpg
<vob file="video.mpg" chapters="0,2:38,4:51,8:38,9:42,10:55,11:50,12:45,15:13,16:10,17:54,18:01,23:10,24:45" />Save the snapshots using File->Save->Save JPEG Image.... Give each snapshot a name that corresponds to the chapter numbers as ch-01.jpg, ch-02.jpg, ch-03.jpg, so things don't get mixed up.
and mkstill-dvd to create a sequence of menus containing the screenshots. Fancier menus can be hand crafted with Gimp but there is no need for a tape archive DVD.
$ snap2menu ch-??.jpg $ mkstill-dvd menu-1.png $ mkstill-dvd menu-2.png
Next load Gimp with the snapshots and paste them together to make a nice cover. A 720x480 snapshot should be deinterlaced and rescaled to 640x480 before being used on the cover. Paste the most interesting snapshots together along with a date the video was shot and the label of the original source tape archived on the DVD. Note the cover's for CD cases are 5.5"x4.75" and the covers for DVD cases are 10.75"x7.25". I save my covers as 300dpi .png files and place a copy of the file on the DVD in a folder named EXTRA.
Use dvdauthor to author the dvd. A typical xml description for a disk is something like
<dvdauthor> <vmgm> <menus> <video aspect="4:3" /> <pgc entry="title"> <vob file="splash.mpg" /> <post>jump titleset 1 menu;</post> </pgc> </menus> </vmgm> <titleset> <menus> <video aspect="4:3" /> <pgc entry="root"> <vob file="menu-1.mpg" /> <button>jump title 1 chapter 1;</button> <button>jump title 1 chapter 2;</button> <button>jump title 1 chapter 3;</button> <button>jump title 1 chapter 4;</button> <button>jump title 1 chapter 5;</button> <button>jump title 1 chapter 6;</button> <button>jump title 1 chapter 7;</button> <button>jump title 1 chapter 8;</button> <button>jump title 1 chapter 9;</button> <button>jump menu 2;</button> </pgc> <pgc> <vob file="menu-2.mpg" /> <button>jump title 1 chapter 10;</button> <button>jump title 1 chapter 11;</button> <button>jump title 1 chapter 12;</button> <button>jump title 1 chapter 13;</button> <button>jump title 1 chapter 14;</button> <button>jump menu 1;</button> </pgc> </menus> <titles> <video aspect="4:3" /> <pgc> <vob file="video.mpg" chapters="0,2:38,4:51,8:38,9:42,10:55,11:50,12:45,15:13,16:10,17:54,18:01,23:10,24:45" /> <post>call menu;</post> </pgc> </titles> </titleset> </dvdauthor>
Save the above into the file dvd.xml and then author the disk with
$ dvdauthor -o disk1 -x dvd.xml
Check the DVD to make sure the menus work with the command
$ vlc disk1/
If you need to change the xml file and rerun dvdauthor first remove the output directory with
$ rm -r disk1
and run dvdauthor -o disk1 -x dvd.xml again. Please make sure you know what the -r option means in the above rm command before you use it, because it is surprisingly easy to erase every single file in your account with this option. When you are satisfied type
$ growisofs -dvd-compat -dvd-video -Z/dev/dvd disk1
to burn the DVD.
Note that some DVDs created with DVD recorders have VOB files that weren't multiplexed properly. These DVDs can be fixed by ripping the VOB files, remultiplexing them with avidemux2_gtk in copy mode and then rewriting them to a DVD using DVD author.
Last Updated: Tue Jun 10 23:54:29 PDT 2008