[Ffmpeg-devel] x264 global headers?

Loren Merritt lorenm
Mon Jan 16 21:25:45 CET 2006


On Mon, 16 Jan 2006, Luca Abeni wrote:

> when encoding (for example) MPEG4 video (or AAC audio) with ffmpeg, I
> can set the CODEC_FLAG_GLOBAL_HEADER flag to obtain the stream "global
> headers" (to be used, for example as a config information in an SDP) in
> AVCodecContext:extradata.
>
> I'd like to obtain similar global headers when encoding H.264 video with
> x264, but I see that libavcodec/x264.c does not support
> CODEC_FLAG_GLOBAL_HEADER... I do not know much about H.264, but I think
> the concept of "global headers" still applies, because if I understand
> well they are required to write the sprop-parameter-sets attribute in an
> SDP file. So, would it be possible to write CODEC_FLAG_GLOBAL_HEADER for
> libavcodec/x264.c? If yes, how difficult would it be?
>
> I do not know how to use the x264 library, but if someone can give me
> some hints I can try to implement support for the
> CODEC_FLAG_GLOBAL_HEADER flag.

To tell x264 not to put the global headers in the video stream:
   x4->params.b_repeat_headers = 0;
And then get them separately:
   x264_encoder_headers(x4->enc, nal, nnal);

--Loren Merritt





More information about the ffmpeg-devel mailing list