Director’s Cut: Let’s Roll Out A DVD Movie

I am an unabashedly proud owner of a MacBook and I was taken aback at how easy it was to create and edit a home video DVD on it. Being a downright fan of GNU/Linux, however, the first impulse I had was to replicate the experience on Fedora, a GNU/Linux flavour that I am terribly attached to and have come to swear by over the last few years.

This article is my attempt at sharing some of my findings with you. I don’t know if these are the best possible techniques, but I am sure that they work. I have also tried to write this article so that one could use any part of the home video DVD creation process without having to go through all the others. I will also try to point out alternatives and references on the Web that might contain more information on these alternatives.

A user of intermediate proficiency with GNU/Linux would very easily be able to follow the steps listed below. Novices can surely follow, but might require a little patience.

Breakdown

Here are the steps that you would roughly need to follow to get your home video DVD that can be played back on a standalone DVD player:

  • Import your video footage from your camera
  • Edit, arrange and beautify (add music, special effects, etc) your video footage
  • Convert your work into DVD compatible video
  • Create a layout (menus) for your DVD
  • Burn your DVD

Let me mention at the outset that following the guidelines in this article might turn out easier on Fedora than on other GNU/Linux distros, but definitely won’t be impossible. For Fedora users, the Livna repository (which has recently been merged with RPMFusion) will be very handy, and you should first add the repository by clicking on all the right places at rpmfusion.org/Configuration. Add both the free and non-free repositories.

Once this is done, you can install any required software for your home DVD with yum.

Importing video footage

The way to import video footage would depend largely on the equipment that you have. If you use a digital (still) camera to capture your video, then the process is as simple as attaching your camera to your Linux box via a USB cable and copying the files off it. Personally, I use a card reader.

If you use a tape-based video camera, which is a little dated (like the one I have), then you are probably going to need some extra hardware on your machine. I have a very cheap PCI TV card on my machine that, apart from having the RF input for the TV signal, also has a Composite and an S-Video input. These are just different standards for analogue video, and S-Video is supposed to give somewhat better video quality than Composite. For most of us, the difference will be imperceptible.

Using an appropriate cable, connect the output of your video camera to the input of your TV card. At this point you are ready to transfer the footage to your hard disk. I use mencoder, brother of MPlayer, and in my mind an underrated and underused piece of software. You should definitely have these two gems installed on your machine. Do that with:

yum -y install mplayer mencoder

You are probably going to have yum install a whole lot of other dependencies with it as well, so don’t panic!

Now there are two ways in which we could use mencoder to import the video. One would be to import using real-time encoding to some popular video format like Xvid, or we could import raw footage, that is, unencoded video format. An encoding algorithm would, of course, take much less space than raw footage, but it would also result in some loss of quality.

I prefer to import raw video and work on it. That’s because we will eventually have to encode the edited movie to the particular format that DVD video uses, and encoding twice will result in quality that you might not be too happy with. However, you could also just take the video you have shot and convert it into an encoded format like Xvid without any editing. (This could be done if you have a DVD player that also supports DivX file formats and you are sure that you don’t have any unnecessary footage—or also if you are plain lazy!)

Here are a couple of variations on the same theme. Both of these would grab video coming from the TV card and encode it on-the-fly to a specified format.

mencoder -of avi -tv driver=v4l:input=1:device=/dev/video0:forceaudio:norm=NTSC:width=640:height=480 
-ovc lavc -lavcopts vcodec=mpeg4:vbitrate=2000 -oac mp3lame -lameopts cbr:br=224 -o output.avi tv://

mencoder -of avi -tv driver=v4l:input=1:device=/dev/video0:forceaudio:norm=PAL:width=640:height=480 -ovc xvid -xvidencopts 
pass=2:bitrate=300 -oac mp3lame -lameopts cbr:br=224:mode=3 -o output.avi tv://

More information on the parameters used here can, of course, be obtained by man mencoder, but here is a breakdown of the essentials:

  • -of avi specifies the output file format to be an audio-video interleave (a .avi file basically)
  • norm specifies your camcorder/TV card output standard (mine can be changed)
  • -ovc defines the type of video encoding to be used (the first uses lavc and the second xvid)
  • -oac defines the output audio format (mp3 in both cases)
  • -o specifies the output file name

You might need to change some settings depending on your software set-up. For example, you might try driver=v4l2 if it is supported on your system. Your input device might be different from /dev/video0 (unlikely though). input=1 specifies the Composite input on my TV card (that’s where I connect the video camera). mode=3 specifies the same (mono) output to be routed to both the output channels—don’t use that if you have a stereo output coming in; use it if you find sound coming out of one speaker only when you play back your output file. vbitrate and bitrate are the video bitrates and a higher value for either would provide better quality at the cost of a bigger output file. tv:// is to instruct mencoder to take the input from the TV card.

I suggest you experiment a little with short captures (let’s say between 10 and 20 seconds; you need to press Ctrl+c to stop the encoding) with different parameters, to see and decide for yourself what works for you before jumping headlong into a big project. You can quickly play back the short clip with mplayer <outputfilename>.

But as I mentioned, I like working with raw video, so I use:

mencoder -of avi -tv driver=v4l:input=1:device=/dev/video0:forceaudio:norm=PAL:width=640:height=480 
-ovc copy -oac copy -o output.avi tv://

Be warned that this will take up an abnormal amount of disk space because this does a raw dump of both audio and video streams. If disk space is at a premium, it would serve you well to use the lavc option (given above) with a higher vbitrate so that you have a decent trade-off between hard disk usage and quality.

You’ll have to run one of these commands and simultaneously play back the tape on your camcorder. After that you should have your output file on your hard disk. This will be your raw footage. If you are uncomfortable with one large file you can manually pause the camcorder from time to time and start encoding in a different file.

Editing and arranging footage

This really is a part of the DVD creation process that cannot be taught. How you go about this step would depend on your personal aesthetics and sense of artistry. Crisp editing will do wonders for any movie—I guarantee that from personal experience.

What is more pertinent for this article is the software that you could use to do your video magic. There are a number of choices available, but I like Kino (that’s because it is in many ways similar to iMovie on the Mac). Again, Fedora users can just install Kino with:

yum install kino

For my favourite tutorial you can view www.yourmachines.org/tutorials/kino.html. It will teach you everything that you need to know, including how to add titling to your movie (for credits, etc), how to add black video to segregate various portions of your footage, how to add transitions, and how to trim your clips to discard unnecessary video footage, amongst various other techniques.

With Kino, you might get a little lost when you have finished editing and want to export your final movie. To export your work, go to the Export tab (the lowest tab on the extreme right hand column of the Kino window) and go to the DV File tab. Right above this tab, make changes so that it reads “Every 1 frame of All”, otherwise you’ll end up exporting a single clip instead of the entire movie. And keep the Raw DV selected.

Converting output into DVD video

DVD video has its own specific audio and video formats. Before you can create a DVD that you can view on a standalone player or on your computer software, you need to encode your finished project to this format.

For this you need to use the following commands:

mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd -vf scale=720:576,harddup -srate 48000 
-af lavcresample=48000 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=15:
aspect=4/3:acodec=ac3:abitrate=192
 -ofps 25 -o output.mpg input.format

If you want output for the widescreen format, you’ll have to change the aspect to 16/9 instead of 4/3. input.format refers to the output file from Kino. (Remember the .dv file that you exported?)

You might also just want to make a VCD from your home movie. (Maybe it’s a short movie or you are a little stingy with DVDs!) Like DVDs, VCDs also have their own specific encoding. You’ll have to use the following:

mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=xvcd -vf scale=352:288,harddup -srate 44100 
-af lavcresample=44100 -lavcopts vcodec=mpeg1video:keyint=15:vrc_buf_size=327:vrc_minrate=1152:
vbitrate=1152:vrc_maxrate=1152:acodec=mp2:abitrate=224:aspect=4/3 -ofps 25 -o output.mpg input.format

If you are a little more technically inclined, I’ll urge you to study the commands for the DVD and VCD formats by yourself. It does not matter how little you understand—it’ll be a start.

DVD cosmetic design

If you’ve done everything well till now, you should be in a position to create a DVD disc. By this I refer to the menus that you often see on DVDs with which you can navigate to see different features on the disc. You would want to have a DVD menu when you are burning more than one home video to a DVD disc, or if you have a particularly long video project (like a family marriage) and want to split it up into the various days it was spread over. Be warned however, that this splitting up would need to be done in Kino; that is, instead of exporting one large file depicting the entire event, you would need to export a few smaller files.

For the DVD disc creation we would be using a small but power-packed member of the FOSS world, namely DeVeDe. The following command should do the trick:

yum install devede

Figure 1: The main DeVeDe window

Figure 1: The main DeVeDe window

I should probably mention at this point that DVDStyler is also a good choice and may suit those more artistically oriented. But in its present avatar, it is a nightmare to install on Fedora 9/10. Ubuntu users will probably have a better time as www.dvdstyler.de provides .deb packages. But back to DeVeDe…

Once you start up DeVeDe, you will be asked about what kind of disc you want to create. Answer ‘DVD Video’ to that. You will be presented with a screen that looks like what is shown in Figure 1.

In the box (on the left hand side), which says Titles, for fun and games, press the Add button three or four times. Each time you will find a new title appearing. When you are done clicking, press the Preview Menu button (circled in red). What you see will be the first look of what your DVD menu could look like. You will see a background picture and a number of titles corresponding to the number of times that you clicked the Add button earlier. Press OK.

Figure 2: Title properties

Figure 2: Title properties

Of course, the menu right now is incapable of doing anything. You would have to associate your DVD video files with it and surely you would want to name those titles a little more descriptively than Title 1, Title 2, etc.

To change the default title names, select the title that you want to change and click on the Properties button. You will see Figure 2. Change the name to whatever you want to and associate an action with this title by selecting a corresponding option. For a really great touch, you can harness the power of GNU/Linux to write the titles in your mother tongue. I do my titling and credits in Bangla whenever I can.

To make changes to the global menu layout, press the Menu Options button (circled in blue). You will then see Figure 3. I could explain what everything here does, but it would be better if you experiment for yourself. Make a change and hit the Preview Menu button at the bottom of the window to see what the DVD menu now looks like. You can also have a selected sound file playing in the background when your menu is displayed. Professional stuff! Figure 4 is an example of a DVD menu that could be created.

Figure 3: Menu Options

Figure 3: Menu Options

Now, you would need to associate the video file you want to play when each title is selected. Go back to the window in Figure 1. Select the title you want to associate a video with and press the Add button under the Files box (which is adjacent to the Titles box). Select your video file. Go and click the little triangle beside Advanced Options, go to the Misc tab and select the checkbox which says “This file is already a DVD/xCD-suitable MPEG-PS file”. We are going to do this because we have already used mencoder to convert our edited video footage to DVD compatible video.

Once you are done allotting video files to all your titles, you are ready to create the DVD ISO. Click the Forward button in the window from Figure 1. You will be asked for a place to store the DVD image. Please heed the warning of not saving to a FAT32 partition. A FAT32 cannot store any file over 4 GB (a DVD image can be as large as 4.3 GB) and all kinds of horrible things will happen. (Lesson: Avoid anything even remotely connected to the Windows world :-))

Figure 4: An example menu

Figure 4: An example menu

When DeVeDe is finished with the process you will find an ISO with whatever name you selected, saved at whatever directory you chose. (I am assuming that you have kept the default options from Figure 1.)

Burn, baby burn!

You are a step away from sweeping friends and family off their feet. Fire up K3b. If it is not already on your system, Yum is your best friend. Select Tools–>Burn DVD ISO Image

The rest is easy. You can play back this DVD on a standalone player.

Afterthoughts

Before I leave you with dreams of your movie, let me point out some things that you could explore further.
Kino is capable of Firewire capture, so if you have a Firewire port and a similarly enabled video camera, you could get your footage straight from your camera to Kino.

DVD compatible video can be created through Kino and DeVeDe as well. I’ll leave that exercise to you, if you haven’t noticed it already. In essence, it uses mencoder commands in the background that are very similar to the ones that I have written about. In addition, DeVeDe can encode to XviD as well.

DeVeDe also allows you to create a VCD, as does K3b. While DeVeDe can encode to VCD compatible video, you’ll have to manually do the encoding for K3b with mencoder from the command line. In K3b, select Further Actions… in the Quickstart tab you can select New Video CD Project.

DVDStyler allows you to customise your menu item graphics and also allows you to place them anywhere on the DVD menu screen.

I am hoping that this article will take you a step closer to completely shifting to GNU/Linux. For the last eight years, I have had no OS but Fedora on my desktop. And I am an average (but dedicated) GNU/Linux user.

Last but not least, while I have done some experimentation, I have learnt about a lot of the material presented here from sources on the Web. I am afraid I cannot acknowledge everyone because I keep all these commands in a text file in my home directory, and have no idea where I collected them from. But rest assured, it wouldn’t have been possible without the great Open Source Community.

All published articles are released under Creative Commons Attribution-NonCommercial 3.0 Unported License, unless otherwise noted.
Open Source For You is powered by WordPress, which gladly sits on top of a CentOS-based LEMP stack.

Creative Commons License.