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)

attachment_video.mov (691.7 KB ) - added by Jiejun 7 years ago.
a mp4 with both edit list and multiple stsds which does not decode correctly

Download all attachments as: .zip

Change History (7)

by Jiejun, 7 years ago

Attachment: attachment_video.mov added

a mp4 with both edit list and multiple stsds which does not decode correctly

comment:1 by Jiejun, 7 years ago

I also submitted a patch for this issue, please take a look.

comment:2 by Carl Eugen Hoyos, 7 years ago

Keywords: mov added
Version: unspecifiedgit-master

How long is the video supposed to play?

in reply to:  2 comment:3 by Jiejun, 7 years ago

Replying to cehoyos:

How long is the video supposed to play?

20s

comment:4 by Carl Eugen Hoyos, 7 years ago

Keywords: h264 edts added

comment:5 by Balling, 3 years ago

The patch is here.

https://patchwork.ffmpeg.org/project/ffmpeg/list/?submitter=200&series=&q=&archive=&delegate=&state=*
Last edited 7 months ago by Balling (previous) (diff)

comment:6 by Balling, 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.

Note: See TracTickets for help on using tickets.