diwatu
diwatu

Reputation: 5699

FFmpeg avcodec_find_encoder(AV_CODEC_ID_OPUS) and avcodec_find_decoder(AV_CODEC_ID_OPUS) both return NULL

The FFmpeg I am using is fine, because it works if I use AV_CODEC_ID_PCM_U8 and some the other CODEC with avcodec_find_encoder and avcodec_find_decoder.

Anybody knows why the finder coder functions always return NULL with AV_CODEC_ID_OPUS?

Upvotes: 0

Views: 1585

Answers (2)

Paul Gregoire
Paul Gregoire

Reputation: 9793

Once your ffmpeg lib has --enable-libopus you may also use avcodec_find_decoder_by_name("libopus") and avcodec_find_encoder_by_name("libopus")

Upvotes: 0

George Y.
George Y.

Reputation: 11789

You need to check three things:

  • Is your fmpeg compiled with opus decodec? What does ffmpeg -decoders | grep libopus say?
  • Do you call av_register_all?
  • Is libopus present on your machine, and is it the same version ffmpeg expects (I'd try strace/ltrace)?

libopus is not compiled in by default:

ffmpeg-2.1.3> ./configure --help | grep opus
  --enable-libopus         enable Opus decoding via libopus [no]

so you need to specify --enable-libopus (and of course have libopus in your toolchain)

Upvotes: 2

Related Questions