[Libav-user] Accessing and constructing AVCodecContext for all versions of FFmpeg

Jean-Yves Avenard jyavenard at gmail.com
Thu Jan 7 05:50:02 CET 2016


In a recent commit, AVCodecContext was modified in a way that it's now
not compatible across all versions of FFmpeg and LibAV.

I had opened ticket https://trac.ffmpeg.org/ticket/5057 but it's been
decided that it won't be fixed.

I was given an alternative, cross-platforms way to set AVCodecContext
using AVDictionary to set most of the fields.

However, that leaves me with how to modify the extradata /
extradata_size member.

For the context, in the project I work on (Firefox), we do not ship
with any ffmpeg or libav libraries. We simply attempt to dlopen
whichever one is present and will do what needs to be done in setting
the decoder.

We also do not use libavformat, only libavcodec and the decoding part.

As such, we manually extract the extradata (either from the inband
SPS/PPS or from the mp4 container).

I don't see a way on how we could access the AVCodecContext::extradata
member that would work across all versions of libavcodec wherever it's
coming from.

Any ideas?

More information about the Libav-user mailing list