How to make DivX-player-compatible DVDs with FFmpeg


Last updated on

Introduction

I’ve always found that the most frictionless way to enjoy watching media on a television is using some sort of physical media player that was designed to connect to a television. This might be a VCR, DVD player, Blu-Ray player, or perhaps something more exotic. For me, it’s usually a DVD player. I’ve got plenty of them and plenty of blank DVDs.

I recently wanted to watch a lovely show called Midnight Caller on my portable DVD player. I started by just burning a lot of DVDs of episodes, in native DVD video format, using a piece of software called Ashampoo Burning Studio. (Not a sponsor - it’s just the Windows software I’m used to that I know works well.) That worked fine and my player had no issues. However, only about 4 episodes fit per disk without a noticeable degradation in quality, and at 61 episodes for the show, that was going to be 15 whole DVDs! That’d take awhile to burn, and use up a lot of blank media.

One day, while staring at my DVD player (as one does,) I noticed a little badge on the front with the DivX logo. This brought up some very vague memories of DVD players that were able to play files on a data DVD, or something. I decided to research it a bit further. It was surprisingly hard to find any useful information, or much information at all that wasn’t generic LLM-generated text, so I’ve decided to document it here.

DivX

What the heck is a DivX?

The Wikipedia article for DivX doesn’t make it clear what DivX actually is, so I’m going to spell it out here for you: It’s a particular proprietary implementation of the MPEG-4 Part 2 video codec. That’s it. There’s not a whole lot more to it. It’s important to note that MPEG-4 Part 2 is different from what you might think of as MPEG-4 - likely MPEG-4 Part 10, AKA H.264. We’re talking about good old MPEG-4 Part 2 today. Again, DivX is just another implementation of MPEG-4 Part 2.

What’s a DivX DVD, then?

First of all, it has nothing to do with Digital Video Express, so if you see any references to that, ignore them. A DivX DVD is simply an ISO-9660 format data DVD - that is, a perfectly standard data DVD - with a bunch of DivX (MPEG-4 Part 2!) encoded video files on it.

The exact container format used for those video files depends on what a particular player supports, but AVI seemed like a good bet from my research. I’ve seen references to a specific DivX container format, but I didn’t do any further research into that.

How do I make a DivX DVD?

I found most of the information here in the FFmpeg wiki.

First, you’ve got to encode all the video files you want on your DVD:

ffmpeg -i $INPUT_FILE \ 
    -c:v libxvid -vtag DIVX -b:v 1500k \ 
    -c:a libmp3lame -b:a 128k -ar 48000 \ 
    $OUTPUT_FILE.avi

One of the magic incantations here is -vtag DIVX, which sets the FourCC code of the video file to DIVX, which is necessary for some players to correctly detect the file as a DivX-encoded file.

As far as I’m aware, you don’t actually have to use the libxvid library - mpeg4 is fine - but the documentation claims that libxvid will deliver better quality at low bitrates, and I was using a relatively low bitrate.

You can tune the video bitrate as you see fit, 1500k was fine for my purposes, and my understanding is that some players aren’t capable of playing back much higher bitrates anyways.

MP3 appears to be widely supported as an audio codec by DivX-capable players.

Burning the DVD

Once you have all the encoded files, you just need to burn them as a standard data DVD to your disc. I used Nero Burning ROM because it’s what I’m familiar with for this purpose. I made sure to turn off all “flexibility” offered by Nero in the ISO format, in case my player didn’t like discs that technically violated the ISO spec.

One thing to note is that each filename may be truncated to 16 characters or less by your player, so be sure to put any important information necessary to differentiate the files (eg: episode numbers) at the start of the filename.

How do I play this magic DVD of yours?

Simply insert the disc into your player. It should pop up a built-in menu that allows you to choose a file from the list to play back. That’s it!

If it doesn’t work, I’d check the following, in order:

  • Does the DVD player support DivX?
  • Did the media burn OK in the first place (can you read it back on a computer?)
  • Did you burn the files in the correct data format?
  • Did you encode the files and set the FourCC correctly?

Conclusion

Using these encode settings, I was able to fit 9 or 10 episodes per standard 4.7GB DVD, which is much better than the fixed 4 episodes I was able to fit using DVD video format discs!

Hopefully this has demystified what exactly a DivX-capable DVD player is capable of, and how to take advantage of this capability. I hope it’s helped someone other than me - and if not, at least I have this to refer back to when I inevitably need to do it again in the future!