[Ffmpeg-devel] I'm giving up

Loren Merritt lorenm
Wed Dec 6 18:27:02 CET 2006

On Wed, 6 Dec 2006, M?ns Rullg?rd wrote:
> Luca Abeni said:
>> On Wed, 2006-12-06 at 16:49 +0100, Michael Niedermayer wrote:
>> [...]
>>>> I know that I can ask the codec to encode PPS and SPS inline, and then
>>>> parse the stream to remove them... But why generating some NALs and then
>>>> removing them? I was under the impression that the
>>>> CODEC_FLAG_GLOBAL_HEADER flag was designed to help in this case, no? If
>>>> not, what's its purpose?
>>> CODEC_FLAG_GLOBAL_HEADER should cause the encoder to put the global header(s)
>>> in extradata, of course it should use the same format as is used in the
>>> bytestream if possible, any container specific reformating belongs to some
>>> other layer IMHO
>> Of course this it what I meant since the beginning (this is why I got
>> confused by this "NAL form / raw form / bytestream form" discussion :).
> The spec is quite clear that NAL units always are encoded the same way.  The
> bytestream format is defined as one possible way of separating NAL units.
> The raw data (RBSP) should be extracted from the NAL unit by the decoder.
> One could of course argue that the escaping is not needed when format with
> separate framing is used.  Our resident codec expert is out at the moment so
> I can't ask him why this is always required.  I'll try to catch him when he
> gets back.

I can confirm that, in the standard, the "startcode emulation prevention" 
process is part of the specification of a NAL unit, and is independent of 
whether or not bytestream format is used.
However, I don't know why either. It has been asked on jvt-experts, and 
not answered.

--Loren Merritt

More information about the ffmpeg-devel mailing list