Opened 7 years ago
Last modified 5 months 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)
Change History (3)
by , 7 years ago
Attachment: | bear-1280x720-a_frag-cenc_clear-all.mp4 added |
---|
comment:1 by , 7 years ago
Keywords: | regression added |
---|---|
Priority: | normal → important |
Reproduced by developer: | set |
Status: | new → open |
Version: | unspecified → git-master |
comment:2 by , 5 months ago
This now prints (appears to be fixed):
[aac @ 000001fb9a9cc000] channel element 0.0 duplicate [aist#0:0/aac @ 000001fb9a9d0600] [dec:aac @ 000001fb9a9da300] Decoding error: Invalid data found when processing input Output #0, framecrc, to 'out.txt':
Regression since 69b5ce64d2260b01e28feb81527ad282bfcdf43b