Opened 6 years ago

Last modified 6 years ago

#6818 open defect

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

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

Description

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:

http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavcodec/decode.c;hb=HEAD#l528
http://git.videolan.org/?p=ffmpeg.git;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 Dale Curtis 6 years ago.

Download all attachments as: .zip

Change History (2)

by Dale Curtis, 6 years ago

comment:1 by Carl Eugen Hoyos, 6 years ago

Keywords: regression added
Priority: normalimportant
Reproduced by developer: set
Status: newopen
Version: unspecifiedgit-master
Note: See TracTickets for help on using tickets.