Opened 8 years ago

Closed 7 years ago

#6138 closed defect (wontfix)

MP4 video is not displayed

Reported by: cgbug Owned by:
Priority: important Component: avformat
Version: git-master Keywords: mov edts regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: yes

Description

Change History (9)

comment:1 by Carl Eugen Hoyos, 8 years ago

Keywords: mov edts regression added
Priority: normalimportant
Reproduced by developer: set
Status: newopen
$ ffmpeg -i aerials.mp4 -qscale 2 out.avi
ffmpeg version N-83477-gd96ebc5 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --enable-opengl
  libavutil      55. 46.100 / 55. 46.100
  libavcodec     57. 77.100 / 57. 77.100
  libavformat    57. 66.102 / 57. 66.102
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 73.100 /  6. 73.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'aerials.mp4':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6avc1mp41
    creation_time   : 2014-03-07T10:35:18.000000Z
  Duration: 00:04:03.23, start: 0.000000, bitrate: 838 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 854x480 [SAR 1:1 DAR 427:240], 709 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default)
    Metadata:
      creation_time   : 2014-03-07T10:35:18.000000Z
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
    Metadata:
      creation_time   : 2014-03-07T10:34:53.000000Z
      handler_name    : SoundHandler
Please use -q:a or -q:v, -qscale is ambiguous
Output #0, avi, to 'out.avi':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6avc1mp41
    ISFT            : Lavf57.66.102
    Stream #0:0(und): Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 854x480 [SAR 1:1 DAR 427:240], q=2-31, 200 kb/s, 29.97 fps, 29.97 tbn, 29.97 tbc (default)
    Metadata:
      creation_time   : 2014-03-07T10:35:18.000000Z
      handler_name    : VideoHandler
      encoder         : Lavc57.77.100 mpeg4
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
    Stream #0:1(und): Audio: ac3 ([0] [0][0] / 0x2000), 44100 Hz, stereo, fltp, 192 kb/s (default)
    Metadata:
      creation_time   : 2014-03-07T10:34:53.000000Z
      handler_name    : SoundHandler
      encoder         : Lavc57.77.100 ac3
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> mpeg4 (native))
  Stream #0:1 -> #0:1 (aac (native) -> ac3 (native))
Press [q] to stop, [?] for help
frame=    0 fps=0.0 q=0.0 Lsize=    5875kB time=00:04:03.25 bitrate= 197.8kbits/s speed= 284x
video:0kB audio:5701kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.042248%

comment:2 by Sasi Inguva, 8 years ago

This video has a video edit list with duration zero.
elst
entry_count: 1
segment duration, media time, media rate, media rate fraction
0, 3003, 1, 0

With the edit list being parsed correctly from that patch on, we don't get any video. This is the same behavior when played through QuickTime 10.4 or QuickTime 7. Looks like ffmpeg is doing the right thing now.

comment:3 by cgbug, 8 years ago

It might be correct from the perspective of a video editor. But FFmpeg is also widely used by video playback applications. So there should really be an option to ignore the edit list. Maybe an option to ignore it completely (disabled by default) and an option to avoid discarding entire tracks like in this sample (enabled by default).

comment:4 by Carl Eugen Hoyos, 8 years ago

What's wrong with -ignore_editlist 1?
Note that not ignoring the edit list is crucial for playback of many relevant samples.

comment:5 by cgbug, 8 years ago

My apologies, I didn't know that option already existed.

https://www.w3.org/2013/12/byte-stream-format-registry/isobmff-byte-stream-format.html
Section 3 mentions a single edit list with a duration of zero. But I am not sure how to interpret it.

comment:6 by Aleksoid1978, 8 years ago

if edit list have 1 entry with duration = 0 and media time > 0 - it must interpret as timestamp offset(delay) for all packets. And when read packet need add this offset to packet timestamp.
This idea/code is working in MPC-BE.

Last edited 8 years ago by Aleksoid1978 (previous) (diff)

comment:7 by Sasi Inguva, 8 years ago

It is not clear if the edit list duration zero section in ​https://www.w3.org/2013/12/byte-stream-format-registry/isobmff-byte-stream-format.html speaks for non-fragmented MP4 files too.

At least I played such a file using HTML5 video tag, and it doesn't play. Until it is clear in the specification, I will ask you to please use the -advanced_editlist=0 option to make these files playable.

This option was introduced in ​http://git.videolan.org/?p=ffmpeg.git;a=commit;h=ef71dc7948322254d1f0fa41218b91f2da0279d9 and will turn off the edit list parsing features introduced in http://git.videolan.org/?p=ffmpeg.git;a=commit;h=ca6cae73db207f17a0d5507609de12842d8f0ca3

comment:8 by cgbug, 8 years ago

The file originates from the web (YouTube) so it might have actually been fragmented originally and merged by the download tool.

comment:9 by Sasi Inguva, 7 years ago

Analyzed by developer: set
Resolution: wontfix
Status: openclosed

Closing this bug as wontfix. As explained in the comment:7, I think we are doing the right thing, and we are also consistent with what Quicktime player does. Please use -advanced_editlist=0 for workaround.

Note: See TracTickets for help on using tickets.