Consumer Video to DVD under GNU/Linux
by Ross Bernheim, firstname.lastname@example.org
Consumer desktop video on Linux, mid-2003, can be done, but not as easily as on Mac OS X using iMovie and iDVD. For high-end work, Linux offers programs with steep learning curves, incredible power, and hardware requirements (such as Cinellera, formerly Broadcast 2000). However, for simple, easy-to-use consumer-grade software for video editing and burning to DVD, Linux lags behind proprietary operating systems such as OS X and Windows.
This is my attempt to provide Linux desktop video users a simplified HOWTO: It's stripped of un-needed details, and describes a process that works for me — to get my analog video into the Linux box, edit it, and then prepare the edited video for burning to DVD and finally burn the DVD. If you're converting video from a digital video camcorder, this process should work for you, also, but you won't need the analog-to-digital video bridge.
My environment is an AMD Athlon DX2000-based Linux box with 1/2 gigabyte of memory and a Firewire card, 40 gigabyte 7200 RPM hard disk, Knoppix/Debian Linux on the hard disk, and a borrowed Dazzle analog-to-digital-video (DV) bridge with Firewire output. The video card is an old S3 Voodoo-based card that's so old it doesn't even have a fan, and a Toshiba ATAPI DVD-R/RW burner. At the time I assembled the machine, I thought that the Athlon DX2000 represented a good value point, with sufficient processing speed to do the video jobs that I wanted to do, without requiring expensive dedicated-processor add-ons.
One note on the video card is that it does have problems with some video playback programs, unless the card is set to 16-bit rather than 24-bit color. mplayer works well with no problems or fussiness as to 24-bit color.
I use kino (http://kino.schirmacher.de) to do video capture, editing, and conversion to MPEG for DVD. kino edits raw digital video, in contrast to other video editors that use other formats, requiring you to spend time and effort converting the incoming digital video to those formats. The drawback to using raw digital video is that it takes up a lot more disk space.
I use dvdauthor (http://dvdauthor.sourceforge.net) to do DVD authoring, and mkisofs (http://www.andante.org/mkisofs.html) to create ISO images to be burned to DVDs. DVDs need to be in a specific format for a DVD player to read them. Authoring puts the MPEG-encoded video and audio in the proper format and allows for DVD features such as navigation, chapters, and menus. dvdauthor at this time supports only a minimal set of such features. The DVD-burning tool then requires that the authored files be arranged into a single image of what will be burned to the DVD. mkisofs is what makes this ISO9660 file system, which is what will be subsequently burned to the DVD.
I use dvdrecord (http://www.nongnu.org/dvdrtools) to do the DVD burning. Note that DVD+RW/+R for Linux (http://fy.chalmers.se/~appro/linux/DVD+RW) supports burning DVD-R, as of version 5.0. The combination of Linux and my Athlon DX2000 CPU is adequate for consumer video. A faster machine might speed up a few operations, whereas a slower machine might encounter noticeable frame dropping during video capture. I haven't experienced noticeable frame dropping. I start kino from the terminal, to see progress messages. The console messages say kino is dropping some frames. However, it isn't noticeable. Adjusting the Capture Buffers under the kino preferences' IEEE 1394 tab will minimize dropped frames.
kino lets you adjust video display quality. During capture, preview's a bit jerky, at times, but the video thus captured is fine. Note that there are differences between the way the computer handles DV playback and the way DVD players handle MPEG-encoded video. As a result, there are visual "artifacts" on the computer's display of the DV that don't appear in the finished DVD. This is most noticeable at the top of the video being played back on the computer.
- Capture the video to disk.
- Edit the video.
- Convert to MPEG for DVD.
- Make DVD disk file system.
- Make an ISO9660 disk image to burn to DVD.
- Burn DVD.
I use a Dazzle analog-to-digital-video (DV) bridge with output to the input jack of an inexpensive Firewire PCI card in my Linux box. The Dazzle is quite easy to use. Plug your video and audio into the analog inputs, connect the Firewire cable to the Firewire output, and plug the other end into the Linux box's Firewire port. Plug in the power, and select the analog-to-digital mode using the switch on the Dazzle's back panel. That's all the Dazzle needs.
If you have a digital video camera, it may be able to act as a bridge from analog sources, as well.
Use kino to capture video as DV.
kino requires that a number of Preferences settings be set:
On the File menu, select Preferences. In the Defaults tab, select Normalisation NTSC for American TV, 48kHz Stereo for the Audio, and 4:3 for the Aspect Ratio.
Under the Capture tab, Browse to where you want to save the captured video as a file. Select the File Type: I used Raw DV. Under the Other File Options, select Auto Split Files and Put Timestamp in the File Name. You might also want to increase the Frames per File and Max File Sizes, so that you end up with fewer files to deal with.
Under the IEEE 1394 tab, select the Video 1394 Device. Mine was /dev/video1394. The interface for mine was 0, the channel was 63, and capture buffers was set to 50. The VCR control was grayed out, as I didn't have a VCR connected.
Select Capture mode using the tab for that purpose on the main window's right-hand side. Use the Browse button to locate where you want to save the captured video, and provide a file name for the saved video. Depending on how many video files you'll be capturing, you might want to invent a naming system to help you remember what's in each file (rather than a generic filename like "capture").
Roll the video, and hit the Capture button to start capturing. Hit the Stop button to end capturing.
Edit the Video.
Edit with Kino.
Using the Trim feature, separate sections and cut those not wanted. Save the project out as a single file.
When you've finished capturing video, you need to edit it to remove unwanted scenes. There are a number of ways to do this. Since I'm using video from television, it has those pesky commercials in it. I usually start by going to the Trim tab and going to the end of what I don't want, what I do, and the end of what I do want and don't. At these points, I use the Separate command in the toolbar, the thing that looks somewhat like a winner's podium with 1st, 2nd, and 3rd place, to break apart the video into separate sections.
By selecting the separated section containing just the unwanted material, you can use the Cut command, the scissors icon in the toolbar, to eliminate it. When you're done with this procedure, you can use the Join command, the paper clip icon in the toolbar, to join the sections together. At this point, I usually use Kino to convert the file to MPEG, to use in making a DVD.
You can use the timeline to rapidly locate and move around in the video, and then move back to Edit or Trim mode.
Convert to MPEG for DVD.
Convert to MPEG2 for DVD with Kino.
Go to the Export tab, on the right side of the kino window, and click on it. The central frame will come up with options. If your machine opens the standard-width window, you will have to click on the little right pointing triangle several times, to move the focus on the horizontal options until you get to Audio. Click once more, and the tabs will scroll to reveal the hidden MPEG tab. Click on the MPEG tab, and the central frame will now show MPEG export options. Click and hold the File Format control, to reveal the types of file outputs available. I chose 8-DVD. Give the file a location to save it to, and a name, by filling in the proper fields and then exporting. With my system, it takes approximately 3 minutes to export each minute of video. A half-hour TV program with the commercials trimmed is about 20 minutes in length. This 20 minutes of video takes approximately 1 hour and 5 minutes or so to encode to MPEG for DVD use, using the fast de-interlacer setting. Other settings might increase this time significantly. For my use, the fast de-interlacing works well, so I have not tried the other settings. MPEG encoding is where a faster system or dedicated MPEG encoder chip might help.
You will want to check the converted MPEG files. They should play correctly in mplayer or xine.
After you've captured, edited, and converted your video to MPEG for DVD and individually checked the files, you need to check that the total is less than the 4.7 gigabyte capacity of a DVD. Total up the file sizes for the files you want to burn to the DVD: This should be less than 4,700 megabytes. Don't forget to allow some extra space for additional files required for DVD structure and navigation.
Create DVD structure
Master the DVD using dvdauthor, to create proper files and structure. dvdauthor will try to infer any unspecified options. Default is NTSC 4:3 720full.
Create empty file tree to start with. ("foobar" is a directory name.)
dvddirgen -o foobar(Note: If dvddirgen doesn't work, mkdir will also work to create the empty folder for the file tree.)
Now, we need to put the files in the folder, and put them in a form the DVD player can deal with.
Populate the filesystem:
dvdauthor -o foobar movie1.mpg movie2.mpg movie3.mpg movie4.mpg
A few words about chapters: dvdauthor will automatically add chapter markers at the beginning of each file. You can add extra chapters using the -c switch. You must add this flag after each file, to split all movies into smaller chapters.
Now, we need to create the extra files to tell the DVD player how to handle the files and where they are, etc. Create DVD information (IFO) files:
dvdauthor -o foobar -T
You should now you have a complete DVD file system, including all additional files. It should look like this:
Make ISO9660 disk image, to burn to DVD.
Now, the files have to be turned into a single ISO9660 image, to burn to DVD.
Create ISO9660 disk image using mkisofs:
mkisofs -dvd-video -o file folder
mkisofs Syntax Summary:
- mkisofs — Use the mkisofs utility to make an ISO9660 file
- -dvd-video — make (specifically) the file system for a video
- -o "filename" — output to a file named "filename"
- folder — path to directory where files to be used as input are located
- mkisofs — Use the mkisofs utility to make an ISO9660 file system
6. Burn DVD.
Burn DVD with dvdrecord
dvdrecord -v speed=1 -dao dev=0,0 file
The -v option raises the feedback level, so that you get more feedback during the burn process.
The speed=1 option sets the burn speed. Start with a speed of 0, and check the buffer percentages before trying to raise the number in integers, i.e., 1 or 2.
The -dao tells dvdrecord to use the disk-at-once file option to burn the ISO image as one continuous file.
The dev=0,0 tells dvdrecord to use the device at SCSI location 0,0, which is the first device on the first SCSI chain. This doesn't really exist on my machine, but is where the Toshiba ATAPI DVD burner gets mapped to, under Linux.
Setting up the ATAPI drive to use the IDE-SCSI shim driver is necessary, before dvdrecord can see the DVD burner. Setting this up is outside the scope of this HOWTO.
The filename is the name of the ISO9660 file you want to burn to the DVD.
dvdrecord Syntax Summary:
- dvdrecord — use the dvdrecord utility
- -v — report progress
- speed=1 — use single-speed (slow) mode
- -dao — record using disk-at-once
- dev=0,0 — use device at SCSI 0,0
- file — the ISO9660 file to burn to DVD
My thanks to Rick Moen for reviewing this and making numerous editorial suggestions. Remaining flaws are my own.
— Ross Bernheim
 This refers to a Dazzle Hollywood DV-Bridge, which digitally samples incoming analogue audio & video, producing DV digital output on the Dazzle's outgoing Firewire port. Consensus on-line, however, is that similarly priced models from Canopus Corporation are slightly more reliable (in synchronising on input signals, etc.).
- dvdrecord — use the dvdrecord utility