[Libav-user] Can't get MPEG4 decoder

Carl Eugen Hoyos ceffmpeg at gmail.com
Thu Nov 9 19:14:44 EET 2017


> Am 09.11.2017 um 17:13 schrieb Michael IV <explomaster at gmail.com>:
> Hi All. What maybe a reason that  avcodec_find_decoder returns NULL ?
> I enabled in my FFMPEG build MOV and h264 demuxer. Configure report clearly
> states that.
> But doing this test:
>          av_register_all();
> 	 avcodec_register_all();
>          avformat_network_init();
>          AVCodec* h264codc = avcodec_find_decoder_by_name("h264");

This is supposed to work.

> 	 AVCodec* h264codc1 = avcodec_find_decoder_by_name("MOV");

This is not the name of any decoder, mov is a file format, you will find a demuxer (and a muxer) with that name (I think).

> 	 AVCodec* h264codc3 = avcodec_find_decoder_by_name("MPEG4");

There is codec "mpeg4" but that's not h264.

> 	 AVCodec* h264codc4 = avcodec_find_decoder_by_name("MP4");

See above for mov, although the same demuxer handles mov and mp4.

> 	 AVCodec* h264codc5 = avcodec_find_decoder(AV_CODEC_ID_MPEG4);

Again, this codec exists but it's not h264.

> Only h264codc  returns a valid codec.

> The only thing I didn't do during build config was not to enable libx264.

This only means that you have no h264 encoder.

> May this be the source of the problem? I didn't do that because I just need to demux  mp4 movie and get its elementary stream.

Then you don't care about a decoder, you only need a demuxer (and maybe a parser).

Carl Eugen

More information about the Libav-user mailing list