FFmpeg fails to decode first frame in file due to multiple frames in a packet.
|Reported by:||Dale Curtis||Owned 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:
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.