Opened 5 months ago

#6511 new defect

The ouput file has no video data at the beginning when transcoding MP4 file

Reported by: GalaDOS Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: mp4, elst
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
When transcoding some MP4 files containing Edit List Box whose media_time value is not zero, the first GOP could not be decode well (I think it is because the IDR frame is skiped by the demuxer). This causes the output files have no video data at the beginning.

How to reproduce:
You can reproduce this with file attached.
My ffmpeg version: git master head (2017-07-05).

$ ./ffmpeg -y -i ~/Public/elst_box_skip_2frames.mp4 ~/Public/elst_box_skip_2frames_output.mp4
ffmpeg version 3.3.git-c8cfbc6 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
  configuration: --prefix=/home/zx/ffmpeg_build --extra-cflags=-I/home/zx/ffmpeg_build/include --extra-ldflags='-L/home/zx/ffmpeg_build/lib -ldl' --bindir=/home/zx/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libmfx --enable-nonfree --disable-shared --enable-static --disable-debug
  libavutil      55. 67.100 / 55. 67.100
  libavcodec     57.100.103 / 57.100.103
  libavformat    57. 75.100 / 57. 75.100
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 94.100 /  6. 94.100
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/zx/Public/elst_box_skip_2frames.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    artist          : yinyuetai.com
    album           : Yinyuetai
    date            : 06/27/17 15:08:38
    encoder         : Lavf56.40.101
    comment         : Yinyuetai-1TR1042
  Duration: 00:00:18.07, start: 0.000000, bitrate: 1099 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 960x540, 994 kb/s, 29 fps, 29 tbr, 29k tbn, 58 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 95 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0x43de8e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
[libx264 @ 0x43de8e0] profile High, level 3.1
[libx264 @ 0x43de8e0] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/home/zx/Public/elst_box_skip_2frames_output.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    artist          : yinyuetai.com
    album           : Yinyuetai
    date            : 06/27/17 15:08:38
    comment         : Yinyuetai-1TR1042
    encoder         : Lavf57.75.100
    Stream #0:0(und): Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 960x540, q=-1--1, 29 fps, 14848 tbn, 29 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc57.100.103 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      encoder         : Lavc57.100.103 aac
frame=  522 fps=185 q=-1.0 Lsize=    1156kB time=00:00:18.01 bitrate= 525.6kbits/s dup=244 drop=0 speed=6.39x    
video:853kB audio:283kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.810231%
[libx264 @ 0x43de8e0] frame I:3     Avg QP:19.18  size: 56207
[libx264 @ 0x43de8e0] frame P:149   Avg QP:20.28  size:  3718
[libx264 @ 0x43de8e0] frame B:370   Avg QP:27.01  size:   404
[libx264 @ 0x43de8e0] consecutive B-frames:  2.1%  9.2%  2.9% 85.8%
[libx264 @ 0x43de8e0] mb I  I16..4: 11.0% 39.9% 49.2%
[libx264 @ 0x43de8e0] mb P  I16..4:  0.5%  0.8%  0.1%  P16..4: 27.3%  8.0%  4.3%  0.0%  0.0%    skip:59.1%
[libx264 @ 0x43de8e0] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8: 15.8%  0.3%  0.0%  direct: 0.1%  skip:83.8%  L0:48.2% L1:49.2% BI: 2.6%
[libx264 @ 0x43de8e0] 8x8 transform intra:46.8% inter:75.1%
[libx264 @ 0x43de8e0] coded y,uvDC,uvAC intra: 58.5% 82.4% 57.8% inter: 3.1% 7.0% 0.5%
[libx264 @ 0x43de8e0] i16 v,h,dc,p: 31% 28% 11% 31%
[libx264 @ 0x43de8e0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 16% 29%  6%  6%  7%  5%  7%  6%
[libx264 @ 0x43de8e0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 18%  9% 10% 10% 10%  7%  8%  6%
[libx264 @ 0x43de8e0] i8c dc,h,v,p: 47% 23% 19% 11%
[libx264 @ 0x43de8e0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x43de8e0] ref P L0: 67.2% 14.5% 14.1%  4.2%
[libx264 @ 0x43de8e0] ref B L0: 92.5%  6.6%  0.9%
[libx264 @ 0x43de8e0] ref B L1: 98.8%  1.2%
[libx264 @ 0x43de8e0] kb/s:387.70
[aac @ 0x43df8a0] Qavg: 1133.271

Attachments (1)

elst_box_skip_2frames.mp4 (2.4 MB) - added by GalaDOS 5 months ago.
This media has a elst box, whose media_time=2000, after transcode, the output file has no video data at the beginning.

Change History (1)

Changed 5 months ago by GalaDOS

This media has a elst box, whose media_time=2000, after transcode, the output file has no video data at the beginning.

Note: See TracTickets for help on using tickets.