Opened 7 years ago
Last modified 7 months ago
#6584 new defect
MP4 with edit list and multiple stsds not decoding correctly
Reported by: | Jiejun | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avformat |
Version: | git-master | Keywords: | mov h264 edts |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
When a MP4 has both edit list and multiple stsds, it does not decode correctly with ffmpeg. An example is https://www.dropbox.com/s/qz0ort4znqq9jdy/attachment_video.mov?dl=0. Such videos can be easily generated by iOS, when using AVMutableComposition and AVAssetExportSession to replace a part of a video with another totally different video.
To reproduce, run:
ffmpeg -i attachment_video.mov frames/frame%03d.jpg
Take a look at frame327.jpg, frame328.jpg, frame329.jpg frame330.jpg. They are pure-green, which is wrong. They should be exactly the same as frame331.jpg.
FFmpeg also prints error messages:
[h264 @ 0x7fbfc9040a00] reference count overflow [h264 @ 0x7fbfc9040a00] decode_slice_header error [h264 @ 0x7fbfc9040a00] no frame! Past duration 0.999992 too large Last message repeated 7 times Error while decoding stream #0:0: Invalid data found when processing input Past duration 0.999992 too large [h264 @ 0x7fbfc9004800] reference count overflow [h264 @ 0x7fbfc9004800] decode_slice_header error [h264 @ 0x7fbfc9004800] no frame! [h264 @ 0x7fbfc9001000] reference count overflow [h264 @ 0x7fbfc9001000] decode_slice_header error [h264 @ 0x7fbfc9001000] no frame! ...
The root cause is that FFmpeg used a wrong stsd to decode several frames.
Attachments (1)
Change History (7)
by , 7 years ago
Attachment: | attachment_video.mov added |
---|
follow-up: 3 comment:2 by , 7 years ago
Keywords: | mov added |
---|---|
Version: | unspecified → git-master |
How long is the video supposed to play?
comment:4 by , 7 years ago
Keywords: | h264 edts added |
---|
comment:5 by , 3 years ago
The patch is here.
https://patchwork.ffmpeg.org/project/ffmpeg/list/?submitter=200&series=&q=&archive=&delegate=&state=*
comment:6 by , 3 years ago
So it warns that h264 does not have a functionality to decode. But considering -ignore_editlist 1 changes behaviour, I think it is indeed the bug in editlist internal workings.
a mp4 with both edit list and multiple stsds which does not decode correctly