[Libav-user] decode audio example broken

drwho drwho at infidigm.net
Wed Nov 21 22:30:54 EET 2018


On 2018-11-21 3:13 p.m., Jaka Bac wrote:
> On Wed, 21 Nov 2018 at 20:47, drwho <drwho at infidigm.net 
> <mailto:drwho at infidigm.net>> wrote:
>
>     Hello,
>
>     The audio decoder example below fails to decode any file I've tried
>     (mp3, opus, wav).....
>
>     [mp2 @ 0x55d075c3d780] Header missing
>     Error submitting the packet to the decoder
>
>     https://libav.org/documentation/doxygen/master/decode__audio_8c_source.html
>
>     Jon
>
>
> Hello,
>
> The audio decoding example specifically uses the MP2 audio codec to 
> decode the audio.
> It does this:
> codec = avcodec_find_decoder(AV_CODEC_ID_MP2);

Hi Jaka,

I've tried changing it to

AV_CODEC_ID_MP3

error = [mp3 @ 0x56136ad2f780] Header missing

AV_CODEC_ID_OPUS

error = [opus @ 0x55caa0cb7200] Error parsing Opus packet header.

I've noticed that the packet size is always 0 after calling 
av_parser_parse2().  It would be nice to have an example for 
avcodec_send_packet() and avcodec_receive_frame() that works.

Jon

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20181121/42241262/attachment.html>


More information about the Libav-user mailing list