[Libav-user] New api and deprecation warning

Michael IV explomaster at gmail.com
Wed Mar 14 21:26:14 EET 2018

Hi. I am trying to get rid of deprecation warning in the API. I am running
ffmpeg -20170711 version. I have a code where I don't explicitly create
because I multiplex already existing h264 NALS. But I still have to setup
AVStream which has AVCodecContext which it creates internally based on the
codec I pass into


.So I have something like this then:

mVideoOutStream->codec->gop_size = muxerParams.gopSize;
mVideoOutStream->codec->time_base.den = mVideoOutStream->time_base.den;
mVideoOutStream->codec->time_base.num = mVideoOutStream->time_base.num;


if (mOutputFormatContext->oformat->flags & AVFMT_GLOBALHEADER)
mVideoOutStream->codec->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;

Every place I access '->codec->' the compiler says it's deprecated,and the
I have to use codecpar instead.But codecpar doesn't have those params. What
do I do in this case? Create explicitly codec context and assign it to the
stream? Looks like newer API has some design gaps.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20180314/da1e7438/attachment.html>

More information about the Libav-user mailing list