Opened 4 years ago

Closed 2 years ago

Last modified 2 years ago

#3962 closed defect (fixed)

Multiple STSD with EDTS demuxing/decoding support (same codec)

Reported by: shahriman Owned by:
Priority: important Component: avformat
Version: git-master Keywords: MOV edts stsd
Cc: Reimar.Doeffinger@gmx.de Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

The sample provided below was decoding fine before this commit:
http://git.videolan.org/?p=ffmpeg.git;a=commit;h=34751f8313a41bf94e004ffa9491f35d96763558.

After the above mentioned commit, all I get from ffmpeg is broken frames and a lot of error messages as follows:

$ ./ffmpeg -i ~/Downloads/multiple_stsd.mp4 -f null -
ffmpeg version N-66326-g8c71de7 Copyright (c) 2000-2014 the FFmpeg developers
  built on Sep 17 2014 16:44:05 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
  configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-libx264 --enable-shared --enable-static --disable-ffserver --enable-libfdk-aac --enable-libfreetype --enable-avresample --enable-openssl --enable-pic
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  4.102 / 56.  4.101
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  1.101 /  5.  1.100
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  0.100 / 53.  0.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x1567020] multiple edit list entries, a/v desync might occur, patch welcome
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x1567020] Concatenated H.264 or H.265 might not play correctly.
    Last message repeated 2 times
[h264 @ 0x15695e0] top block unavailable for requested intra mode at 0 0
[h264 @ 0x15695e0] error while decoding MB 0 0, bytestream 36982
[h264 @ 0x15695e0] concealing 8160 DC, 8160 AC, 8160 MV errors in I frame
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/shakkhar/Downloads/multiple_stsd.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 1
    compatible_brands: mp41mp42isom
    creation_time   : 2014-09-02 15:23:11
  Duration: 00:01:34.93, start: 0.035465, bitrate: 9590 kb/s
    Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 73 kb/s (default)
    Metadata:
      creation_time   : 2014-09-02 15:23:11
      handler_name    : Core Media Audio
    Stream #0:1(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 9506 kb/s, SAR 1:1 DAR 16:9, 30 fps, 30 tbr, 600 tbn, 1200 tbc (default)
    Metadata:
      creation_time   : 2014-09-02 15:23:11
      handler_name    : Core Media Video
Output #0, null, to 'pipe:':
  Metadata:
    major_brand     : mp42
    minor_version   : 1
    compatible_brands: mp41mp42isom
    encoder         : Lavf56.4.101
    Stream #0:0(und): Video: rawvideo (I420 / 0x30323449), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 30 fps, 30 tbn, 30 tbc (default)
    Metadata:
      creation_time   : 2014-09-02 15:23:11
      handler_name    : Core Media Video
      encoder         : Lavc56.1.100 rawvideo
    Stream #0:1(und): Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s (default)
    Metadata:
      creation_time   : 2014-09-02 15:23:11
      handler_name    : Core Media Audio
      encoder         : Lavc56.1.100 pcm_s16le
Stream mapping:
  Stream #0:1 -> #0:0 (h264 (native) -> rawvideo (native))
  Stream #0:0 -> #0:1 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
[h264 @ 0x1566240] top block unavailable for requested intra mode at 0 0
[h264 @ 0x1566240] error while decoding MB 0 0, bytestream 36982
[h264 @ 0x1566240] concealing 8160 DC, 8160 AC, 8160 MV errors in I frame
[h264 @ 0x15512a0] left block unavailable for requested intra mode at 0 1
[h264 @ 0x15512a0] error while decoding MB 0 1, bytestream 11995
[h264 @ 0x15512a0] Cannot use next picture in error concealment
[h264 @ 0x15512a0] concealing 8089 DC, 8089 AC, 8089 MV errors in P frame
[h264 @ 0x1551ae0] top block unavailable for requested intra4x4 mode -1 at 9 0
[h264 @ 0x1551ae0] error while decoding MB 9 0, bytestream 21947
[h264 @ 0x1551ae0] Cannot use next picture in error concealment
[h264 @ 0x1551ae0] concealing 8160 DC, 8160 AC, 8160 MV errors in P frame
[h264 @ 0x1552460] top block unavailable for requested intra mode at 86 0
[h264 @ 0x1552460] error while decoding MB 86 0, bytestream 23531
[h264 @ 0x1552460] Cannot use next picture in error concealment
[h264 @ 0x1552460] concealing 8123 DC, 8123 AC, 8123 MV errors in P frame
[h264 @ 0x1552de0] top block unavailable for requested intra mode at 101 0
[h264 @ 0x1552de0] error while decoding MB 101 0, bytestream 12903
[h264 @ 0x1552de0] concealing 8108 DC, 8108 AC, 8108 MV errors in B frame
[h264 @ 0x1553760] top block unavailable for requested intra4x4 mode -1 at 14 0
[h264 @ 0x1553760] error while decoding MB 14 0, bytestream 23001
[h264 @ 0x1553760] concealing 8160 DC, 8160 AC, 8160 MV errors in P frame
[h264 @ 0x15540e0] concealing 7860 DC, 7860 AC, 7860 MV errors in B frame
[h264 @ 0x1554a60] concealing 7988 DC, 7988 AC, 7988 MV errors in P frame
[h264 @ 0x15553e0] concealing 7861 DC, 7861 AC, 7861 MV errors in B frame
[h264 @ 0x1566240] top block unavailable for requested intra mode at 86 0
[h264 @ 0x1566240] error while decoding MB 86 0, bytestream 14323
[h264 @ 0x1566240] top block unavailable for requested intra4x4 mode -1 at 94 14
[h264 @ 0x1566240] error while decoding MB 94 14, bytestream 10767
[h264 @ 0x1566240] Cannot use next picture in error concealment
[h264 @ 0x1566240] concealing 8123 DC, 8123 AC, 8123 MV errors in P frame
[h264 @ 0x15512a0] concealing 8077 DC, 8077 AC, 8077 MV errors in B frame
[h264 @ 0x1551ae0] top block unavailable for requested intra4x4 mode -1 at 88 0
[h264 @ 0x1551ae0] error while decoding MB 88 0, bytestream 13140
[h264 @ 0x1551ae0] top block unavailable for requested intra4x4 mode -1 at 105 14
[h264 @ 0x1551ae0] error while decoding MB 105 14, bytestream 8210
[h264 @ 0x1551ae0] Cannot use next picture in error concealment
[h264 @ 0x1552460] top block unavailable for requested intra mode at 2 15
[h264 @ 0x1552460] error while decoding MB 2 15, bytestream 5714
[h264 @ 0x1551ae0] concealing 8121 DC, 8121 AC, 8121 MV errors in P frame
[h264 @ 0x1552de0] top block unavailable for requested intra mode at 113 14
[h264 @ 0x1552de0] error while decoding MB 113 14, bytestream 8095
[h264 @ 0x1552460] concealing 8125 DC, 8125 AC, 8125 MV errors in B frame
[h264 @ 0x1552de0] concealing 8142 DC, 8142 AC, 8142 MV errors in P frame

How to reproduce:

$ ./ffmpeg -i ~/Downloads/multiple_stsd.mp4 -f null -
ffmpeg version N-66326-g8c71de7 Copyright (c) 2000-2014 the FFmpeg developers
  built on Sep 17 2014 16:44:05 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)

I have uploaded the sample to ffmpeg FTP here: ftp://upload.ffmpeg.org/incoming/multiple_stsd.mp4

I have inspected the streams. It looks like the video has a few parameter switch in the middle in both audio and video streams, e. g. stereo -> mono, resolution switch, and such.

Change History (14)

comment:1 Changed 4 years ago by cehoyos

  • Keywords MP4 removed
  • Priority changed from normal to important
  • Version changed from unspecified to git-master

comment:2 follow-up: Changed 4 years ago by michael

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in d0b27fe8f13d56f409448f27c4c08fc9a49bad4d

Also if someone has the file that was fixed by 34751f8313a41bf94e004ffa9491f35d96763558, please share it, the url in that commit is dead

comment:3 Changed 4 years ago by cehoyos

  • Resolution fixed deleted
  • Status changed from closed to reopened

Current FFmpeg shows warnings and artefacts that were not visible before 34751f83

$ ffmpeg -i multiple_stsd.mp4 -t 45 -an -qscale 2 out.avi
ffmpeg version N-66637-g02f7665 Copyright (c) 2000-2014 the FFmpeg developers
  built on Oct  6 2014 01:06:18 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl
  libavutil      54.  9.100 / 54.  9.100
  libavcodec     56.  2.101 / 56.  2.101
  libavformat    56.  7.104 / 56.  7.104
  libavdevice    56.  1.100 / 56.  1.100
  libavfilter     5.  1.102 /  5.  1.102
  libswscale      3.  1.100 /  3.  1.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  1.100 / 53.  1.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x37a5c60] multiple edit list entries, a/v desync might occur, patch welcome
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x37a5c60] Concatenated H.264 or H.265 might not play correctly.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x37a5440] ignoring multiple glbl
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x37a5c60] Concatenated H.264 or H.265 might not play correctly.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x37a5440] ignoring multiple glbl
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x37a5c60] Concatenated H.264 or H.265 might not play correctly.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x37a5440] ignoring multiple glbl
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'multiple_stsd.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 1
    compatible_brands: mp41mp42isom
    creation_time   : 2014-09-02 15:23:11
  Duration: 00:01:34.93, start: 0.035465, bitrate: 9590 kb/s
    Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 73 kb/s (default)
    Metadata:
      creation_time   : 2014-09-02 15:23:11
      handler_name    : Core Media Audio
    Stream #0:1(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 9506 kb/s, SAR 1:1 DAR 16:9, 30 fps, 30 tbr, 600 tbn, 1200 tbc (default)
    Metadata:
      creation_time   : 2014-09-02 15:23:11
      handler_name    : Core Media Video
Please use -q:a or -q:v, -qscale is ambiguous
Output #0, avi, to 'out.avi':
  Metadata:
    major_brand     : mp42
    minor_version   : 1
    compatible_brands: mp41mp42isom
    ISFT            : Lavf56.7.104
    Stream #0:0(und): Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 30 fps, 30 tbn, 30 tbc (default)
    Metadata:
      creation_time   : 2014-09-02 15:23:11
      handler_name    : Core Media Video
      encoder         : Lavc56.2.101 mpeg4
Stream mapping:
  Stream #0:1 -> #0:0 (h264 (native) -> mpeg4 (native))
Press [q] to stop, [?] for help
[h264 @ 0x3f58300] top block unavailable for requested intra4x4 mode -1 at 0 0s/s
[h264 @ 0x3f58300] error while decoding MB 0 0, bytestream 47910
[h264 @ 0x3f58300] concealing 3600 DC, 3600 AC, 3600 MV errors in I frame
[h264 @ 0x3f9d340] top block unavailable for requested intra4x4 mode -1 at 1 0
[h264 @ 0x3f9d340] error while decoding MB 1 0, bytestream 11797
[h264 @ 0x3f9d340] concealing 3600 DC, 3600 AC, 3600 MV errors in P frame
[h264 @ 0x40310e0] top block unavailable for requested intra mode at 30 0
[h264 @ 0x40310e0] error while decoding MB 30 0, bytestream 15252
[h264 @ 0x40310e0] concealing 3600 DC, 3600 AC, 3600 MV errors in P frame
[h264 @ 0x40c4fe0] concealing 3309 DC, 3309 AC, 3309 MV errors in P frame
[h264 @ 0x4158ee0] top block unavailable for requested intra mode at 3 0
[h264 @ 0x4158ee0] error while decoding MB 3 0, bytestream 8368
[h264 @ 0x4158ee0] concealing 3600 DC, 3600 AC, 3600 MV errors in B frame
[h264 @ 0x41ecea0] concealing 3574 DC, 3574 AC, 3574 MV errors in P frame
[h264 @ 0x4280e60] concealing 3595 DC, 3595 AC, 3595 MV errors in B frame
[h264 @ 0x4314e20] top block unavailable for requested intra4x4 mode -1 at 9 0
[h264 @ 0x4314e20] error while decoding MB 9 0, bytestream 11414
[h264 @ 0x4314e20] concealing 3600 DC, 3600 AC, 3600 MV errors in P frame
[h264 @ 0x43a8de0] concealing 3481 DC, 3481 AC, 3481 MV errors in P frame
[h264 @ 0x3f58300] Cannot use next picture in error concealment
[h264 @ 0x3f58300] concealing 3546 DC, 3546 AC, 3546 MV errors in P frame
[h264 @ 0x3f9d340] top block unavailable for requested intra4x4 mode -1 at 9 0
[h264 @ 0x3f9d340] error while decoding MB 9 0, bytestream 6719
[h264 @ 0x3f9d340] concealing 3565 DC, 3565 AC, 3565 MV errors in P frame
[h264 @ 0x40310e0] concealing 3341 DC, 3341 AC, 3341 MV errors in P frame
[h264 @ 0x40c4fe0] concealing 3424 DC, 3424 AC, 3424 MV errors in B frame
[h264 @ 0x4158ee0] top block unavailable for requested intra4x4 mode -1 at 56 4
[h264 @ 0x4158ee0] error while decoding MB 56 4, bytestream 9658
[h264 @ 0x4158ee0] concealing 3589 DC, 3589 AC, 3589 MV errors in P frame
[h264 @ 0x41ecea0] concealing 3239 DC, 3239 AC, 3239 MV errors in B frame
[h264 @ 0x4280e60] concealing 3565 DC, 3565 AC, 3565 MV errors in P frame
[h264 @ 0x4314e20] concealing 3389 DC, 3389 AC, 3389 MV errors in B frame
[h264 @ 0x43a8de0] concealing 3489 DC, 3489 AC, 3489 MV errors in P frame
[h264 @ 0x3f58300] concealing 3421 DC, 3421 AC, 3421 MV errors in B frame
[h264 @ 0x3f9d340] top block unavailable for requested intra4x4 mode -1 at 45 0
[h264 @ 0x3f9d340] error while decoding MB 45 0, bytestream 5797
[h264 @ 0x3f9d340] concealing 3598 DC, 3598 AC, 3598 MV errors in P frame
[h264 @ 0x40310e0] top block unavailable for requested intra4x4 mode -1 at 59 4
[h264 @ 0x40310e0] error while decoding MB 59 4, bytestream 7627
[h264 @ 0x40310e0] concealing 3329 DC, 3329 AC, 3329 MV errors in P frame
[h264 @ 0x40c4fe0] top block unavailable for requested intra4x4 mode -1 at 0 0
[h264 @ 0x40c4fe0] error while decoding MB 0 0, bytestream 6375
[h264 @ 0x40c4fe0] concealing 3551 DC, 3551 AC, 3551 MV errors in P frame
[h264 @ 0x4158ee0] top block unavailable for requested intra mode at 17 5
[h264 @ 0x4158ee0] error while decoding MB 17 5, bytestream 5921
[h264 @ 0x4158ee0] concealing 3490 DC, 3490 AC, 3490 MV errors in P frame
[h264 @ 0x41ecea0] left block unavailable for requested intra4x4 mode -1 at 0 6
[h264 @ 0x41ecea0] error while decoding MB 0 6, bytestream 9298
[h264 @ 0x41ecea0] concealing 3498 DC, 3498 AC, 3498 MV errors in P frame
[h264 @ 0x4280e60] top block unavailable for requested intra mode at 14 0
[h264 @ 0x4280e60] error while decoding MB 14 0, bytestream 4345
[h264 @ 0x4280e60] concealing 3062 DC, 3062 AC, 3062 MV errors in B frame
[h264 @ 0x4314e20] top block unavailable for requested intra4x4 mode -1 at 15 0
[h264 @ 0x4314e20] error while decoding MB 15 0, bytestream 9318
[h264 @ 0x4314e20] concealing 3479 DC, 3479 AC, 3479 MV errors in P frame
frame= 1349 fps=299 q=2.0 Lsize=   83724kB time=00:00:45.00 bitrate=15241.5kbits/s
video:83686kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.045334%
[h264 @ 0x43a8de0] concealing 3258 DC, 3258 AC, 3258 MV errors in B frame

Note that the sample did not play in sync before 34751f83 (and doesn't play in sync now) possibly making this a minor regression.

comment:4 in reply to: ↑ 2 Changed 4 years ago by ubitux

comment:5 follow-up: Changed 4 years ago by shahriman

Thanks Michael. Why is this ticket still open? Is it due to the sync problem you mentioned?

comment:6 in reply to: ↑ 5 Changed 4 years ago by cehoyos

Replying to shahriman:

Why is this ticket still open?

Because current FFmpeg shows warnings and artefacts that were not visible before 34751f83

Is it due to the sync problem you mentioned?

The sync problem imo indicates that this ticket is not important (but normal) but I leave the decision to others.

comment:7 Changed 4 years ago by michael

which warning exactly do you consider a regression ?
also which part of the video is being decoded with artifacts and was decoded without artifacts before ?
I do see parts that where missing previously and show artifacts now

comment:8 Changed 4 years ago by cehoyos

The "JUL 26" scene after ~44 seconds did not show artefacts before 34751f83 and did not show any warnings on decoding.

comment:9 Changed 4 years ago by michael

thats because half the scene was missing. Otherwise please attach a screenschot of a frame that was decoded better previously.
Also decoding all parts with their STSDs is a feature request and its IMO not a regression every time a unsupported feature looks a bit different. The feature request is what time should be directed toward

comment:10 Changed 4 years ago by cehoyos

  • Keywords edts added

comment:11 Changed 4 years ago by michael

  • Keywords stsd added; regression removed
  • Priority changed from important to normal
  • Summary changed from Regression in MP4 demuxer to Multiple STSD with EDTS demuxing/decoding support (same codec)

noone explained in 4 weeks how this could be a regression, also its a dead end to see it as one, the behavior before is not closer to how it should be

comment:12 Changed 4 years ago by michael

  • Priority changed from normal to important

actually, it possibly makes sense to leave this as priority important even when its not a regression.

comment:13 Changed 2 years ago by cehoyos

  • Resolution set to fixed
  • Status changed from reopened to closed

comment:14 Changed 2 years ago by shahriman

Thanks Sasi, Michael and Carl.

Note: See TracTickets for help on using tickets.