[FFmpeg-devel] [RFC] Always set extradata, not only if CODEC_FLAG_GLOBAL_HEADER is set?

Michael Niedermayer michaelni
Tue Jan 8 11:38:51 CET 2008

On Tue, Jan 08, 2008 at 10:45:38AM +0100, Baptiste Coudurier wrote:
> Hi,
> Michael Niedermayer wrote:
> > Hi
> > 
> > Currently several encoders set extradata only if CODEC_FLAG_GLOBAL_HEADER
> > is set.
> > CODEC_FLAG_GLOBAL_HEADER besides this also prevents the global headers from
> > being placed before each keyframe.
> > 
> > maybe we should always set extradata, this would be somewhat simpler and
> > more consistant as many encoders use extradata without looking at
> > CODEC_FLAG_GLOBAL_HEADER and shouldnt do any harm. (no change for muxers which
> > dont support extradata)
> > CODEC_FLAG_GLOBAL_HEADER would still be used to avoid global headers before
> > keyframes.
> > The encoders affected are faac, x264, xvid and mpeg4
> > 
> > Is there any case where setting extradata does harm?
> > 
> I imagine this would cause problems with muxers switching behaviour in
> case of extradata presence and user might not want to use the extradata one.
> adtsenc.c does change his behaviour if extradata is present, and looking
> at the code I suspect that if CODEC_FLAG_GLOBAL_HEADER is not set but
> extradata is, it will write twice adts header. So muxer should be
> changed before.

Also IMHO, adtsenc should if possible check for extradata already being in
the packets either way. Even if we decide not to always set extradata.

And shouldnt adtsenc be a bitstream filter instead of a muxer?


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The worst form of inequality is to try to make unequal things equal.
-- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080108/3c7a8b94/attachment.pgp>

More information about the ffmpeg-devel mailing list