[matroska-devel] [Fwd: Re: Packed bitstream/dx50 VOP handling for AVIs with B-frames in MP4creator ?]

Christian HJ Wiesner chris at matroska.org
Sat Jun 7 21:58:36 CEST 2003

FYI, Bills answer. Seems to me they are creating broken MP4's when 
reading AVIs with b-frames, either way ...

-------- Original Message --------
Subject: 	Re: Packed bitstream/dx50 VOP handling for AVIs with B-frames 
in MP4creator ?
Date: 	Fri, 06 Jun 2003 09:39:47 -0700
From: 	Bill May <wmay at cisco.com>
To: 	chris at matroska.org
CC: 	David Mackie <cahighlander at yahoo.com>, dave at leatherdale.net, 
ed.gomez at free.fr, syskin at ihug.com.au
References: 	<3EE0727B.2050703 at matroska.org>

Christian HJ Wiesner wrote:
> Hi Bill,
> am sending this email to you, but copied to the other developers of the 
> MPEG4IP project also, the matroska development mailing list and also 
> some people helping us with MP4 support .

Okay - great.

> Please allow me to introduce myself, i am one of the project admins of 
> the matroska opensource container project on http://www.matroska.org. 
> Our goal is too create a general use audio/video container format, 
> focussed on storing/editing and support for all existing codecs. More 
> info is on our homepage, as well as the specs and the tools to 
> play/create/edit matroska files.

Okay - that sounds fine to me.  I personally like the QT library that
mp4 is based on, but if you've got a different idea, that's fine with me.

> We have plans to make a transmuxing tool to be able to mux the content 
> of MP4 files into matroska files ( .MKV ), so they can easily be edited 
> in VirtualdubMod ( http://sf.net/projects/virtualdubmod ). This is 
> possible because matroska was designed for high editability, and it 
> doesnt even require the help of the codec for this. There are loud 
> voices from users asking us to do that, so they can transmux their MP4 
> files to MKV, edit them in VirtualdubMod and then remux the files to MP4 
> finally, in a lossless process. matroska, in this case, is only used as 
> an interims storage format for easy editing of MP4 files. We dont have a 
> problem with that, we understand MP4 has a huge advantage as there will 
> be hardware support for MP4 soon, while this is unlikely to ever happen 
> for MKV.

Okay, still with you.

> Based on what is said above, i'd like to ask you the following questions :
> 1. To remux the MKV files into the MP4 format, after editing them in 
> VirtualdubMod or any other editing tool ( we will maybe have a Vegas 
> Video plugin soon ), your tool MP4creator would need the ability to 
> parse them. Could you think of  adding libmatroska ( GPL/QPL ) to 
> MP4creator, and allow transmuxing of MKV files also ? We will gladly 
> help you on how to read them, the library is quite easy to use and has a 
> lot of intelligence built in menahwile to assist developer who want to 
> use it.

No.  I can't do the work, but I'd be glad to have it in the package.  It's
a time thing.  I've got a pregnant wife and a full plate of work things.

I would worry a bit about the licensing - we've tried to stick mostly
with LGPL or Mozilla for our libraries that can't be seperated out

The best thing might be to have a seperate executable that use the
mpeg4ip code, as a seperate project, if you want to stick with GPL.

> 2. When parsing AVI files for muxing into MP4, how do you handle 
> B-frames ? As AVI doesnt normally have support for b-frames, DivX 
> Networks introduced a hack with their so-called dx50 VOP mode, inserting 
> dummy frames into the AVI as placeholders and packing the b-frame itself 
> into the same chunk together with the I/P frame it is referencing to. 
> XviD does that also, but if offering a so-called 'packed bitstream' mode 
> also as alternative. IN both cases an AVI parser, reading the MPEG4 
> frames , would have to get rid of the dummy frames and reorder the 
> b-frames such that coding order is achieved in the final MP4 file. How 
> do you handle that from mp4creator, if at all ? How do you overcome the 
> lagging problem ? Would MP4 files, when created with mp4creator from AVI 
> files with B-frames, be fully MP4 spec compliant if no frame reordering 
> is done ?

I'm really not sure.  I believe that we expect all the frames in decoding
order, and reset the timestamps accordingly.  I believe that the b frames
would need to be in seperate frame chunks.

I'm not sure we even have avi support for b frames.  It might just be
for elementary stream raw files, and then, like I said, we expect it
to be in decoding order.

I've copied Dave Mackie on this - he worked on this more than I did, and
would be able to give an answer.



More information about the Matroska-devel mailing list