Opened 3 years ago

Last modified 3 years ago

#6818 open defect

FFmpeg fails to decode first frame in file due to multiple frames in a packet.

Reported by: dalecurtis Owned by:
Priority: important Component: undetermined
Version: git-master Keywords: regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no


Using ToT with the attached file:

$ ffmpeg -i bear-1280x720-a_frag-cenc_clear-all.mp4 -f framecrc out.txt

[aac @ 0xf57080] Multiple frames in a packet.
[aac @ 0xf57080] channel element 0.0 is not allocated
Error while decoding stream #0:0: Invalid data found when processing input

Which comes from these lines:;a=blob;f=libavcodec/decode.c;hb=HEAD#l528;a=blob;f=libavcodec/aacdec_template.c;hb=HEAD#l3048

The new avcodec_send_packet(), avcodec_receive_frame() APIs offer no way to handle multi-frame packets, yet ffmpeg is still demuxing / creating such packets. So we end up with decoder errors when the remainder of the packet isn't handled.

It seems either ffmpeg should not produce such packets or it should properly handle multi-frame packets; either by extending avcodec_receive_frame() to loop over the remainder of the packet or to have aac_decode_frame() properly do this internally.

Attachments (1)

bear-1280x720-a_frag-cenc_clear-all.mp4 (71.6 KB) - added by dalecurtis 3 years ago.

Download all attachments as: .zip

Change History (2)

Changed 3 years ago by dalecurtis

comment:1 Changed 3 years ago by cehoyos

  • Keywords regression added
  • Priority changed from normal to important
  • Reproduced by developer set
  • Status changed from new to open
  • Version changed from unspecified to git-master
Note: See TracTickets for help on using tickets.