[Ffmpeg-devel] Re: [PATCH] x264 avc encoding, movenc avcC, ctts

Måns Rullgård mru
Mon Feb 20 10:51:29 CET 2006

Baptiste COUDURIER said:
> Luca Abeni wrote:
>> Hi Baptiste,
>> I do not know anything about .mov files and about the MOV muxer, but I
>> think the "codec" part of your patches (x264_avc_nal_encode.patch) might
>> be incorrect:
>> On Sun, 2006-02-19 at 18:23 +0100, Baptiste COUDURIER wrote:
>> [...]
>>>which encodes nals correctly for AVC and write extradata for avcC atom.
>> BTW, what is AVC? I was under the impression that AVC (Advanced Video
>> Coding) = MPEG4 Part 10 = H.264... So, I cannot understand the "encode
>> nals correctly for AVC" part
>> [...]
> AVC is special variant of H264 found in mp4/mov containers. In that
> special variant, nals are encoded a different way. Current h264 decoder
> implement both implementations. You can see in the code lines like :
> if (h->is_avc).

The naming of that field is unfortunate.  AVC and H.264 are different names
for *exactly* the same thing.

>> This breaks applications using extradata. Why do you need to change the
>> extradata format? I am not really an expert, but I think extradata
>> should be the "global headers", and according to some drafts I read the
>> current content of extradata correctly matches H.264 global headers.
> I agree, I can set something like if (x4->is_avc). But anyway, extradata
> in mp4/mov needs to be formatted the way I patched it.

Then it is the job of the mov muxer to format it that way.  The encoder
can't know what file format the encoded data is ending up in.

>> Also, maybe I am wrong, but I was under the impression that
>> CODEC_FLAG_GLOBAL_HEADER should not change the format of the stream, but
>> should simply move "out of band" some parts of the stream (the global
>> headers, in this case). Is this wrong? Can someone of the ffmpeg
>> developers clarify this?
> In fact, when AAC is put in MP4/MOV container it does not contain ADTS
> header, while in AVI it contains them. Same for H264, when in AVI, long
> nal header is used, while in MP4/MOV, nal size and no header/syncword.

AVI is mostly a case of everything done wrong.

M?ns Rullg?rd
mru at inprovide.com

More information about the ffmpeg-devel mailing list