[Libav-user] Opus decoder error concealment

Henry Harrison henry.harrison at garrisontechnology.com
Thu Mar 19 15:07:41 CET 2015

​​I need to know how to generate packet loss concealment data using the ffmpeg opus decoder.

The libopus  API has:

int opus_decode(OpusDecoder *st,
    const unsigned char *data,
    opus_int32 len,
    opus_int16 *pcm,
    int frame_size,
    int decode_fec

Which allows me to specify frame_size. Thus if data==NULL and len==0, the decoder will generate frame_size samples of concealment audio.

However with the ffmpeg codec, using avcodec_decode_audio4(...)​ I'm not clear how to specify that I want to generate N samples of concealment audio?

Unfortunately, setting AVPacket::data=NULL and AVPacket::size to the number of samples required just crashes.



More information about the Libav-user mailing list