How do I encode for a standalone DivX player with Handbrake?
February 2, 2007 2:00 AM   Subscribe

If I use Handbrake for Mac to encode a DVD title to an AVI file with MPEG-4 video and MP3 audio, will it play in a standalone DivX player if I use the ffmpeg codec, or must I use the (much slower) XviD codec instead?

My very limited understanding of these things is that ffmpeg / DivX / XviD are just different codecs that do the same thing - encode and decode MPEG-4/MP3 video streams. Is this right? Or will a standalone DivX player not have the faintest idea what to do with an ffmpeg'd stream, and spit it out?
posted by obiwanwasabi to Computers & Internet (5 answers total) 2 users marked this as a favorite
 
I was just looking into this yesterday. According to wikipedia you should be okay if you're not using "advanced encoding features".

Whatever they are.
posted by gi_wrighty at 3:54 AM on February 2, 2007


Note that when encoding, there isn't actually a Divx option for the format. There's an xvid codec, but your format choices with either codec are AVI, MP4, or OGM containers with MPEG-4 or H.264 video and MP3, AC-3, or Vorbis audio. So far as I've ever been able to determine, in the context of Handbrake, an AVI with MPEG-4 video and MP3 audio is pretty widely compatible with Divx-compatible players regardless of whether it's been encoded with ffmpeg or xvid.

But, you know, it'll take about 5 minutes to encode a short clip and find out for sure, so why not do that?
posted by kindall at 8:59 AM on February 2, 2007


Also I should point out that even though Handbrake may use Xvid/ffmpeg to encode a file, the resultant file looks like DivX:
$ file 13\ Joker\'s\ Wild.avi 
13 Joker's Wild.avi: RIFF (little-endian) data, AVI, 624 x 480, 23.98 fps, video: DivX 5, audio: MPEG-1 Layer 3 (stereo, 44100 Hz)

posted by gi_wrighty at 9:14 AM on February 2, 2007


@gi_wrighty: Good thought. One thing, though: I'm not sure how far the output of file should be trusted, since it doesn't guarantee anything about the actual data in the file, or what the player will do with it.

I'm not an expert on "file," but I think it determines the filetype of what it's pointed at by using the /usr/share/misc/file/magic list of "magic numbers" and corresponding file definitions. So that just means that HandBrake is putting a magic number into the file, which is being listed as Divx.

If you run "cat /usr/share/misc/file/magic | grep DivX" you'll see whatever your system is using to determine that type. On mine (Linux), it just means that it contains the string "dx50" somewhere, I assume in the header.

So while that's a good start, and certainly promising, I think more testing is warranted.

I'd take the same short clip, like a preview from a DVD or something, and encode it with a bunch of different settings, and put them all on a disc and see what the player will handle.
posted by Kadin2048 at 12:03 PM on February 2, 2007


I don't actualy have the standalone player handy - it'll be at my destination - so I can't test it.

However, your collective answers gave me enough to search on to realise that:

(a) there's actually a forum for Handbrake where I should ask silly questions like this;

(b) MPEG-4 Layer 2 is just a standard, that Advanced Simple Profile (ASP - the most widely implemented profile) is just one part of the standard, and that there are legion ways to actually implement it with codecs;

(c) at the end of the day, so long as you have a standards-compliant file, all standalone DivX players are looking for is an expected flag (called a fourcc) to let them know that it is compliant and that they should have a crack at decoding and playback;

(d) it seems that while the default fourcc for ffmpeg is FMP4, a flag rejected by many hardware DivX players, Handbrake's implementation uses a fourcc of DX50, so passing itself off as DivX 5.x/6.x; and

(c) using ffmpeg in Handbrake to make an MPEG-4/MP3 AVI file should be good enough for a standalone player.

All that being said, given that it's up to player manufacturers to implement the MPEG-4 Part 2 standard, it's all a bit of a crapshoot. I'll report back if there are any problems.

Thanks!
posted by obiwanwasabi at 12:49 PM on February 2, 2007


« Older Looking for a specific, well known photo of...   |   Can a visualisation technique be copyright? Newer »
This thread is closed to new comments.