Opened 4 months ago

Last modified 4 months ago

#6584 new defect

MP4 with edit list and multiple stsds not decoding correctly

Reported by: zhangjiejun 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 zhangjiejun 4 months ago.
a mp4 with both edit list and multiple stsds which does not decode correctly

Download all attachments as: .zip

Change History (5)

Changed 4 months ago by zhangjiejun

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

comment:1 Changed 4 months ago by zhangjiejun

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

comment:2 follow-up: Changed 4 months ago by cehoyos

  • Keywords mov added
  • Version changed from unspecified to git-master

How long is the video supposed to play?

comment:3 in reply to: ↑ 2 Changed 4 months ago by zhangjiejun

Replying to cehoyos:

How long is the video supposed to play?

20s

comment:4 Changed 4 months ago by cehoyos

  • Keywords h264 edts added
Note: See TracTickets for help on using tickets.