[Libav-user] global headers problem when encoding/decoding h264

Andrey Utkin andrey.krieger.utkin at gmail.com
Thu Apr 19 15:15:00 CEST 2012

2012/4/19 "Matthias Bühlmann" <genesys at gmx.ch>:
> I'm developing in MSVC++ and use precompiled libraries and thus would like to avoid having to alter the FFMPEG code. Is there any other way how I can either get the global headers into my decoder, so that it can decode the packets on the fly without the need of headers in every packet, or to tell the encoder to add the headers to each frame AND to use global headers?

Hard to say without your code. How do you init the decoding contexts?
BTW, consider publishing here simplified working source code of your
app, especially good if it compiles with gcc and run on linux, coz
majority of developers here use it.

If i had to do such a thing, i'd go with somewhat overheady, but
surely working way:
Initiate _two_ output stream contexts, one for desired output
destination, and second for testing. Also open one input stream
context, for reading the test output. Let test stream be bound to
localhost tcp socket, for example.
When you have the AVPacket, go muxing it into both outputs.
Then, read the test stream, and display the resulting picture after decode.

Andrey Utkin

More information about the Libav-user mailing list