av_register_all() vs. avcodec_register()

7.8k views Asked by At

Instead of calling av_register_all(), is there an example of selecting a single decoder to use? I guess I would have to call avcodec_register(), av_register_codec_parser() etc...

The question is, which functions exactly should be called, because av_open_input_file() fails with -2 if I don't use av_register_all().

1

There are 1 answers

0
mmoment On

There is a way to do that :) I just wrote down all the steps for you which av_register_all does. I thought it might give you a better understanding, since it might not be sufficient to only register the codec. Best would be for yourself to take a look in the source code:

http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/allformats_8c-source.html

1) the Hardware-Acceleration:

av_register_hwaccel(AVHWAccel*accel);

2) the Codecs / Dec,Enc,DecEnc, ext. Libraries etc....

avcodec_register(AVCodec*codec);

3) the Parsers

av_register_codec_parser(AVCodecParser*parser);

4) Bitstream Filters

av_register_bitstream_filter(AVBitstreamFilter*bsf);

5) register Mux/Demuxers

av_register_output_format(AVOutputFormat*ov);
av_register_input_format(AVInputFormat*if);

6) If RTP:

av_register_rtp_dynamic_payload_handlers();
av_register_rdt_dynamic_payload_handlers();

7) Protocols

av_register_protocol2(URLProtocol*pr, int size);

Hope that helped?