From AVI to DVD, the Easy Way


David Shamah, The Jerusalem Post November 29, 2005


With protection of digital rights all the rage today, one has to ask why the movie producers haven't been as quick on the trigger to shoot down serial downloaders who swipe and freely distribute movies, DVDs, TV shows, etc., as have the record companies. After all, illegal distribution of video is at least as widespread as converting CDs to MP3 format and sending them out into the wild beyond for the benefit of the Kazaa crew.

But after doing a few video conversions myself, I think I've figured out the answer: Trying to turn a DVD into a downloadable AVI – or vice versa – is punishment enough for those who don't know what they're doing! The terminology alone – like “muxing” and “demuxing” (note the “u” where the “i” should be) – is confusing enough, and when you find out exactly what all these things mean, and tie up your computers for hours “encoding” files, only to find you've pressed the wrong settings and you have to start all over again, you figure it's just easier to cough up the 50 shekels for the stupid DVD!


But dig we must – and despite the challenges, the ability to “work” video is a lot more useful than saving a few shekels on a DVD. You can actually end up saving lots more shekels by taking your own video with a digital (or even analog) video camera and making DVDs out of them, as well as converting old videotapes of significant past events. You'll not only be a hero to those getting copies of those DVDs – you'll be a wealthier, wiser hero, having saved all that money by doing it yourself instead of bringing it over to your local video maven!


As I mentioned, I will start out with basic conversion techniques and software, and then move on to the more complicated aspects of DVD authoring, like subtitles, switchable audio channels for different languages, etc. The first step, though, is to convert your video into DVD format (MPEG2).


As I also mentioned, I started out working with my Mac Mini, a) because it's there, b) because Macs are supposed to have something over Windows systems when it comes to multimedia, and c) because Mac users can take advantage of one of the best pieces of software written for video work, called ffmpegx (http://http://homepage.mac.com/major4) – and at only $15 for the registered version, one of the most amazing software bargains of all time (I shouldn't really write that, because it will just tempt the authors to raise the price!). Ffmpegx is actually a collection of nearly two dozen Unix video tools developed for Mac OS x (itself based on BSD unix) that allows you to basically input almost any video/audio format and spit out a file converted into nearly any other file type. Of course, it's no Adobe Premiere, but then again, it doesn't cost nearly as much as the corresponding Adobe tools (Premiere, Encore, etc.), which you may decide you want to get if you decide to do heavy duty DVD authoring, but would be overkill if you're just starting out, especially when there are tools like ffmpegx available, in my opinion.


The first step in converting a movie into a format playable on a DVD with ffmpegx is to make sure you can play it on your computer; in this case, working with a Mac, it needs to be playable in Quicktime Player. Of course, as mentioned, you need the right codec to play back the file. Last week, I mentioned AVIcodec, a Windows program, which can identify which codecs are required for video playback on a Mac. Quicktime provides a similar function, but only if you upgrade to the Pro edition (it costs $30). Unfortunately, I haven't been able to dig up a free utility similar to AVIcodec for Macs (if anyone knows of one I'd appreciate hearing about it). To play back AVI files, though, it should be sufficient to install the DivX codec, available at http://www.dirfile.com/divx_video_bundle_for_mac_osx.htm. Ffmpegx also includes the open-source video player, Mplayer, which works more smoothly on some files than Quicktime player, and supports extra features, like subtitles and international text encodings. You may also need the 3ivx and an AC3 codec for audio playback (see http://homepage.mac.com/major4/divx_svcd.html). Once you've ascertained that your computer has the appropriate codecs, you can set up the conversion on ffmpegx, which has built into it the necessary (open-source) encoders to convert files to MPEG2 and MPEG4.


One of the best features of ffmpegx is that it has all the tools you need to precisely fine tune your DVD file, with the ability to manually change the audio and video bitrate (the amount of compression needed to make the video/audio data fit into a specific file size, such as a 4 GB DVD), as well as the screen size, PAL or NTSC framerates, etc. But ffmpegx also has a whole series of presets, which will automatically select the appropriate measurements and selections for each conversion. For example, if you select the DVD conversion preset, the program will automatically select the Mpeg2 and Dolby Ac3 encoders, and determine a bitrate that will ensure that your file fits onto a DVD. There are actually two DVD presets – one that will use the aforementioned mpeG2enc, and one that will use another included encoder, ffmpeg. The former is reputedly does a better job syncing audio and video (or rather ensuring that they stay synced throughout), while the latter does a much better job of encoding. It's worth trying both on a file to see which one works better, for you, as it is to check out this discussion of the difference between the two (http://www.videohelp.com/forum/archive/t265697.html), as well as the ffmpegx forums (http://www.videohelp.com/forum/viewforum.php?f=35). Also see the ffmpegx how-to page (http://homepage.mac.com/major4/howtos.html).


Both presets worked fine with one particular AVI file I was experimenting with, with the DVD-mpeG2enc indeed doing a better job on the syncing. The automatic bitrate calculator included in the presets was also very helpful in ensuring I could actually make a DVD out of this file; several attempts to encode it with iDVD resulted in files that were bigger than the necessary 4GB. Once the encoding is done, you get two versions of the file for burning (use the video_ts/Toast method described in the how-to's for best results). Next time we'll look at some more advanced features of this program, and how to do this conversion on a PC.


Ds@newzgeek.com