View Full Version : Some questions about codec ids in AVI/MKV
Booji Boy
24th February 2006, 23:36
I've noticed something,
when I create an AVI (XviD/AC3) in Nandub v1.0rc2 I get the codec ids "XVID" and "AC3", using "mkvmerge -i" to look at it. When I basically(?) do the same in VirtualDubMod 1.5.10.2 except that I create a MKV file, I get "V_MS/VFW/FOURCC,XVID" and "A_MS/ACM,AC3". Why is that? And what's the difference? Is VirtualDubMod's MKV some kind of AVI inside a Matroska?
Moreover when I then transmux those videos with mkvmerge, those codec ids are retained. Does this mean that mkvmerge actually preserves the properties of those two files, or not? Doesn't it rebuild the structure from scratch, so why are the codec ids still different?
Or is it only a name tag that has nothing to do with the way the files both avi and mkv were made?
foxyshadis
25th February 2006, 01:23
There's something called VFW compatibility mode, which basically stores avi formats in mkv, yes. mkvmerge (and mmg) can mux any avi in that way. Nandub writes broken files, because the official ids are V_MS/VFW/FOURCC + 4cc, and similar for ACM. "XVID" and "AC3" do not exist, but compatibility hacks allow them to be played.
With mpeg4 asp (xvid, divx, etc) you can also use the flag "--engage native_mpeg4" in mkvmerge to convert them into a raw bitstream, with IDs V_MPEG4/ISO/ASP and A_AC3. (This will remove all divx-in-avi hacks.)
There's no reason why transmuxing a stream should change its type, so of course it retains the names. But it will do a frame-by-frame rebuild, along with adding new seek cues to the end.
Booji Boy
25th February 2006, 02:02
Thank you, that's interesting.
So what's actually broken about the Nandub files? I don't think I have yet understood it fully. Is it only the codec ids or the whole file structure that makes it VFW incompatible? I mean don't VirtualDubMod and Nandub both use the same hacks?
And then I assume using "--engage native_mpeg4" will result in files compliant to the up-to-date MPEG standards and is recommended? I don't think I really need VFW compatibility since it's not important for most players nowadays anyway, so I rather have a avi-hack clean matroska file, don't you agree?
foxyshadis
25th February 2006, 03:16
Nandub is from the turn of the millenium; I don't know specifically that it writes bad mkv files other than the id, but it's from so long before the mkv specs were finalized that I wouldn't doubt it was missing some pieces or had garbage in others. Still, if it plays it plays.
VFW is mkv compliant, and can be opened in virtualdubmod, but there isn't much else good to say about it. Native mode orders the bitstream properly, allows proper cutting, and has better seekability. There are threads in the AVC forum about the differences (AVC magnifies the problems). The same native mode can be achieved by muxing to mp4 and then mkv, but this is a lot quicker. :p
Booji Boy
25th February 2006, 20:42
Thanks again, sounds good. Time for me to abandon VfW backwards-compatibility then. :D
EDIT: Oh just to for completenesses sake, is there a mkv muxing tool or a switch for mkvmerge that will produce VfW-mkv files? In fact I did have some sync problems after converting some videos to the mp4 format. Since VirtualDubMod has support for Matroska it probably will work most of the time, but I'm not so sure of its up to date when it comes to MKV...
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.