<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Yes it is mandatory to call:<div>av_register_all() -> <span style="background-color: rgb(255, 255, 255); font-family: Roboto, sans-serif; font-size: 14px; line-height: 22px;">Initialize libavformat and register all the muxers, demuxers and protocols (but not the codecs)</span></div><div>avcodec_register_all() -> <span style="background-color: rgb(255, 255, 255); font-family: Roboto, sans-serif; font-size: 14px; line-height: 22px;">Register the codec and initialize libavcodec.</span></div><div><span style="background-color: rgb(255, 255, 255);"><font face="Roboto, sans-serif"><span style="font-size: 14px; line-height: 22px;">As the documentation says: one of this function has to be called before using any libavcodec function.</span></font></span></div><div><br></div><div>Link to llibav documentation: <a href="https://libav.org/doxygen/master/index.html">https://libav.org/doxygen/master/index.html</a></div><div>Link to FFMPEG which is built 'upon' libav (don't want to enter the fight :-) and provide a better doc (with good search function):</div><div><a href="https://www.ffmpeg.org/doxygen/2.5/index.html">https://www.ffmpeg.org/doxygen/2.5/index.html</a></div><div><br></div><div> </div><div><br></div><div><br></div><div><span style="background-color: rgb(255, 255, 255);"><font face="Roboto, sans-serif"><span style="font-size: 14px; line-height: 22px;"><br></span></font></span></div><div>before using functions related to them.</div><div><div><div>Le 16 juin 2015 à 07:18, Taha Ansari <<a href="mailto:mtaha.ansari@gmail.com">mtaha.ansari@gmail.com</a>> a écrit :</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 15, 2015 at 7:31 PM, Kevin J. Brooks <span dir="ltr"><<a href="mailto:kbrooks@r2c-ss.com" target="_blank">kbrooks@r2c-ss.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I am having and issue with an audio codec.  When I call avcodec_open2 it returns -22.  I have not been able to discover what that code indicates.<br></blockquote><div><br></div><div>Are you calling av_register_all(); before calling any other libav related function? IIRC I used to get such error when I forgot calling initialization function(s).<br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org" target="_blank">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" rel="noreferrer" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
</blockquote></div><br></div></div>
_______________________________________________<br>Libav-user mailing list<br><a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>http://ffmpeg.org/mailman/listinfo/libav-user<br></blockquote></div><br></div></body></html>