Yes it is mandatory to call:
av_register_all() -> Initialize libavformat and register all the muxers, 
demuxers and protocols (but not the codecs)
avcodec_register_all() -> Register the codec and initialize libavcodec.
As the documentation says: one of this function has to be called before using 
any libavcodec function.

Link to llibav documentation: https://libav.org/doxygen/master/index.html
Link to FFMPEG which is built 'upon' libav (don't want to enter the fight :-) 
and provide a better doc (with good search function):
https://www.ffmpeg.org/doxygen/2.5/index.html

 



before using functions related to them.
Le 16 juin 2015 à 07:18, Taha Ansari <[email protected]> a écrit :

> 
> 
> On Mon, Jun 15, 2015 at 7:31 PM, Kevin J. Brooks <[email protected]> wrote:
> 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.
> 
> 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).
> 
> _______________________________________________
> Libav-user mailing list
> [email protected]
> http://ffmpeg.org/mailman/listinfo/libav-user
> 
> _______________________________________________
> Libav-user mailing list
> [email protected]
> http://ffmpeg.org/mailman/listinfo/libav-user

_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to