<div dir="ltr">In 3.1.5 it appears that AVStream::codec is deprecated:<br><div><font face="monospace, monospace"><br>    /**<br>     * @deprecated use the codecpar struct instead<br>     */<br>    attribute_deprecated<br>    AVCodecContext *codec;<br></font><br>But the <a href="https://ffmpeg.org/doxygen/3.1/examples.html">examples linked to from the 3.1.x documentation</a> all use it, for example from the <a href="https://ffmpeg.org/doxygen/3.1/demuxing_decoding_8c-example.html">demuxing/decoding example</a>:<br></div><br>    /* find decoder for the stream */<br>    dec_ctx = st->codec;<br>    dec = avcodec_find_decoder(dec_ctx->codec_id);<div><br></div><div>So:</div><div><br></div><div>  - Either the example needs to be updated, or</div><div>  - AVStream::codec needs to not be deprecated any more, with the API returned to the previously already-working-totally-fine-for-everything form, or</div><div>  - avcodec_open2 needs to take an AVCodecParameters not an AVCodecContext, or</div><div>  - The deprecated warning needs to be updated to make sense, because "use the codecpar struct instead" isn't really actual information, it's mostly a tantalizing breadcrumb to use when going back to scour all the disjoint documentation.</div><div><br></div><div>As for what to actually do now... going from the mystery deprecation message:</div><div><br></div><div>1. The <a href="https://ffmpeg.org/doxygen/3.1/structAVStream.html#a12826d21779289356722971d362c583c">docs for codecpar</a> are completely blank, so that's a dead end.</div><div>2. The <a href="https://ffmpeg.org/doxygen/3.1/structAVCodecParameters.html#details">docs for AVCodecParameters</a> don't really contain any useful info, although they do mention some avcodec_parameters_alloc() function, so let's follow that trail...</div><div>3. The <a href="https://ffmpeg.org/doxygen/3.1/group__lavc__core.html#ga647755ab2252e93221bb345f3d5e414f">docs for avcodec_parameters_alloc()</a> just state the obvious, so that's a dead end.</div><div>4. Uh... let's maybe try googling for AVStream codecpar?</div><div>  - <a href="https://ffmpeg.zeranoe.com/forum/viewtopic.php?t=3678">Looked promising</a>, but nothing.</div><div>  - Everything else is pretty much just like that.</div><div>5. So... let's look at the <a href="https://ffmpeg.org/doxygen/3.1/avformat_8h.html">avformat docs index</a> for something that takes an AVCodecParameters: Nope, bad guess. Next guess:</div><div>6. The <a href="https://ffmpeg.org/doxygen/3.1/avcodec_8h.html">avcodec docs index</a>: Well, there's this <a href="https://ffmpeg.org/doxygen/3.1/group__lavc__core.html#gac7b282f51540ca7a99416a3ba6ee0d16">avcodec_parameters_to_context</a> thing. The docs say what it does but not why you'd want to use it. So in the absence of any actual high level information about how the parts of these libraries fit together to accomplish goals, I'm just going to guess that I should take the AVStream::codecpar, convert it (or whatever it is that function does) to an AVCodecContext (instead of just using AVStream::codec to begin with), then pass that off to avcodec_open2 (at least, until that's deprecated in favor of avcodec_open456 the next time the perpetually unstable API gets a facelift), all the while wondering what I really just gained by using codecpar instead of codec.</div><div><br></div><div>So:</div><div><br></div><div>- Is that what it meant by use codecpar instead? I'm really just guessing, because none of it is <i>actually </i>documented.</div><div><br></div><div>- What did I just gain by switching over to codecpar from codec? </div><div><br></div><div>- That was way too much of a wild goose chase. Is there actual organized documentation anywhere so I don't have to keep doing this?</div><div><br></div><div>Jason</div></div>