Opened 6 years ago

Closed 6 years ago

#6969 closed defect (invalid)

H.264 MP4 playback issues relative to Apple Compressor

Reported by: Brendan Bolles Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: libx264
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug: FFmpeg H.264 MP4 movies don't play as well as similar movies encoded with Apple Compressor.

How to reproduce: Create an H.264 MP4 from FFmpeg, and another using Apple Compressor. Then play the movies in QuickTime player or VLC. The Apple version generally maintains frame rate much better than the FFmpeg version.

Or just try playing the two MP4s I'm attaching.

% ffmpeg -v 9 -loglevel 99 -i timelapse_original_prores.mov -c:v libx264 -pix_fmt yuv420p -b:v 28M timelapse_H264_FFmpeg.mp4
ffmpeg version N-89803-g856b7cae9f-tessus Copyright (c) 2000-2018 the FFmpeg developers
  built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
  configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay
  libavutil      56.  7.100 / 56.  7.100
  libavcodec     58.  9.100 / 58.  9.100
  libavformat    58.  3.100 / 58.  3.100
  libavdevice    58.  0.100 / 58.  0.100
  libavfilter     7. 11.101 /  7. 11.101
  libswscale      5.  0.101 /  5.  0.101
  libswresample   3.  0.101 /  3.  0.101
  libpostproc    55.  0.100 / 55.  0.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument '9'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '99'.
Reading option '-i' ... matched as input url with argument '/Volumes/Rodan/WTF/compressor_tests/timelapse_original_prores.mov'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'libx264'.
Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel format) with argument 'yuv420p'.
Reading option '-b:v' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '28M'.
Reading option '/Volumes/Rodan/WTF/compressor_tests/timelapse_H264_FFmpeg.mp4' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument 9.
Successfully parsed a group of options.
Parsing a group of options: input url /Volumes/Rodan/WTF/compressor_tests/timelapse_original_prores.mov.
Successfully parsed a group of options.
Opening an input file: /Volumes/Rodan/WTF/compressor_tests/timelapse_original_prores.mov.
[NULL @ 0x7fbfb8001600] Opening '/Volumes/Rodan/WTF/compressor_tests/timelapse_original_prores.mov' for reading
[file @ 0x7fbfb7907600] Setting default whitelist 'file,crypto'
Probing mov,mp4,m4a,3gp,3g2,mj2 score:100 size:2048
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'ftyp' parent:'root' sz: 32 8 316698793
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] ISO: File Type Major Brand: qt  
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'wide' parent:'root' sz: 8 40 316698793
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'mdat' parent:'root' sz: 100378979 48 316698793
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'free' parent:'root' sz: 2199 100379027 316698793
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'wide' parent:'root' sz: 8 100381226 316698793
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'mdat' parent:'root' sz: 115897543 100381234 316698793
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'free' parent:'root' sz: 3999 216278777 316698793
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'wide' parent:'root' sz: 8 216282776 316698793
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'mdat' parent:'root' sz: 100399484 216282784 316698793
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'free' parent:'root' sz: 5649 316682268 316698793
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'wide' parent:'root' sz: 8 316687917 316698793
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'mdat' parent:'root' sz: 12 316687925 316698793
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'moov' parent:'root' sz: 10864 316687937 316698793
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'mvhd' parent:'moov' sz: 108 8 10856
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] time scale = 24
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'trak' parent:'moov' sz: 5515 116 10856
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'tkhd' parent:'trak' sz: 92 8 5507
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'tapt' parent:'trak' sz: 68 100 5507
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'load' parent:'trak' sz: 24 168 5507
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'edts' parent:'trak' sz: 36 192 5507
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'elst' parent:'edts' sz: 28 8 28
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] track[0].edit_count = 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] duration=600 time=0 rate=1.000000
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'tref' parent:'trak' sz: 20 228 5507
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'tmcd' parent:'tref' sz: 12 8 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'mdia' parent:'trak' sz: 5267 248 5507
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'mdhd' parent:'mdia' sz: 32 8 5259
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'hdlr' parent:'mdia' sz: 58 40 5259
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] ctype=mhlr
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] stype=vide
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'minf' parent:'mdia' sz: 5169 98 5259
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'vmhd' parent:'minf' sz: 20 8 5161
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'hdlr' parent:'minf' sz: 57 28 5161
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] ctype=dhlr
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] stype=alis
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'dinf' parent:'minf' sz: 36 85 5161
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'dref' parent:'dinf' sz: 28 8 28
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] Unknown dref type 0x73696c61 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'stbl' parent:'minf' sz: 5048 121 5161
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'stsd' parent:'stbl' sz: 152 8 5040
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] size=136 4CC=jpeg codec_type=0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'gama' parent:'stsd' sz: 12 8 50
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'pasp' parent:'stsd' sz: 16 20 50
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'colr' parent:'stsd' sz: 18 36 50
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] nclc: pri 1 trc 1 matrix 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'stts' parent:'stbl' sz: 24 160 5040
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] track[0].stts.entries = 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] sample_count=600, sample_duration=1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'stsc' parent:'stbl' sz: 28 184 5040
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] track[0].stsc.entries = 1
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'stsz' parent:'stbl' sz: 2420 212 5040
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] sample_size = 0 sample_count = 600
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] type:'stco' parent:'stbl' sz: 2416 2632 5040
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fbfb8001600] AVIndex stream 0, sample 0, offset 30, dts 0, size 592637, distance 0, keyframe 1

[snip]

bitrate=28786.5kbits/s speed=0.932x    
video:87401kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.010320%
Input file #0 (/Volumes/Rodan/WTF/compressor_tests/timelapse_original_prores.mov):
  Input stream #0:0 (video): 600 packets read (316675982 bytes); 600 frames decoded; 
  Input stream #0:1 (data): 0 packets read (0 bytes); 
  Total: 600 packets (316675982 bytes) demuxed
Output file #0 (/Volumes/Rodan/WTF/compressor_tests/timelapse_H264_FFmpeg.mp4):
  Output stream #0:0 (video): 600 frames encoded; 600 packets muxed (89499061 bytes); 
  Total: 600 packets (89499061 bytes) muxed
600 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x7fbfb6d00900] Statistics: 2 seeks, 345 writeouts
[libx264 @ 0x7fbfba002800] frame I:3     Avg QP: 9.45  size:547582
[libx264 @ 0x7fbfba002800] frame P:151   Avg QP:15.40  size:215439
[libx264 @ 0x7fbfba002800] frame B:446   Avg QP:17.35  size:124046
[libx264 @ 0x7fbfba002800] consecutive B-frames:  0.7%  0.3%  1.0% 98.0%
[libx264 @ 0x7fbfba002800] mb I  I16..4:  6.5% 77.3% 16.2%
[libx264 @ 0x7fbfba002800] mb P  I16..4:  1.5% 48.8%  1.1%  P16..4: 20.5% 17.1% 10.2%  0.0%  0.0%    skip: 0.8%
[libx264 @ 0x7fbfba002800] mb B  I16..4:  0.5% 31.8%  0.6%  B16..8: 26.2% 12.1%  3.5%  direct:16.4%  skip: 8.9%  L0:38.2% L1:33.2% BI:28.5%
[libx264 @ 0x7fbfba002800] final ratefactor: 14.46
[libx264 @ 0x7fbfba002800] 8x8 transform intra:95.8% inter:66.4%
[libx264 @ 0x7fbfba002800] coded y,uvDC,uvAC intra: 97.4% 73.0% 49.5% inter: 64.4% 74.8% 25.0%
[libx264 @ 0x7fbfba002800] i16 v,h,dc,p:  6%  4%  9% 81%
[libx264 @ 0x7fbfba002800] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10% 13% 44%  5%  5%  4%  6%  5%  9%
[libx264 @ 0x7fbfba002800] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 14% 16% 16%  7% 13%  7% 13%  5%  9%
[libx264 @ 0x7fbfba002800] i8c dc,h,v,p: 59% 22% 15%  5%
[libx264 @ 0x7fbfba002800] Weighted P-Frames: Y:21.2% UV:14.6%
[libx264 @ 0x7fbfba002800] ref P L0: 34.1% 17.3% 30.2% 15.3%  3.1%
[libx264 @ 0x7fbfba002800] ref B L0: 74.8% 20.1%  5.1%
[libx264 @ 0x7fbfba002800] ref B L1: 90.9%  9.1%
[libx264 @ 0x7fbfba002800] kb/s:28639.48
[AVIOContext @ 0x7fbfb7a00080] Statistics: 316797049 bytes read, 4 seeks

Change History (2)

comment:1 by Brendan Bolles, 6 years ago

OK, actually the files were uploaded using VideoLAN File Uploader.

comment:2 by Carl Eugen Hoyos, 6 years ago

Keywords: libx264 added
Resolution: invalid
Status: newclosed

(Only one file was uploaded)

Given that FFmpeg does not contain code to encode h264, I don't think this is a valid ticket.
The x264 documentation should explain how to encode with the goal of faster decoding.

Note: See TracTickets for help on using tickets.