[FFmpeg-user] x264 output is hardly watchable in QT7

Lou lou at lrcd.com
Sun Nov 24 02:45:27 CET 2013


On Sat, 23 Nov 2013 17:07:22 -0800
Elliott Balsley <elliottbalsley at gmail.com> wrote:

> I’m converting a 1080p ProRes video to 1080p x264, and the following command produces a file that doesn’t work in QuickTime Player 7.  Seek time is slow (~30 seconds), playback stutters, and sometimes shows visual glitches.  It plays fine in QuickTime X and VLC.  Anyone know what might be wrong with the encoding settings?

Which QuickTime version exactly? Is this on 10.6 Snow Leopard or higher?

> $ ffmpeg -i input.mov -pix_fmt yuv420p -acodec libfdk_aac -b:a 128k -vcodec libx264 -preset veryslow -crf 21 -level 41 -profile high -bf 16 -rc-lookahead 250 -tune film  output.mp4

* You should use -profile:v instead of just -profile since a same named
  option can be used by some audio encoders. It is better to be explicit
  instead of ambiguous.

* Why do you choose -level and -profile? The defaults that the encoder
  end up with are usually recommended unless you are restricted by
  an old or dumb device or a stupid decoder (and in this case I'd assume
  it would choose profile High, Level 4.0 anyway).

* Why do you use -bf? This option is already covered by the preset. Why
  16?

* -rc-lookahead is also dealt with by the preset. Why 250?

* libfdk_aac can use -vbr instead of -b:a if you prefer:
  https://trac.ffmpeg.org/wiki/AACEncodingGuide

...
> [libx264 @ 0x7fb0fa806600] profile High, level 4.1
> [libx264 @ 0x7fb0fa806600] 264 - core 138 r2358 9e941d1 - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=1 ref=16 deblock=1:-1:-1 analyse=0x3:0x133 me=umh subme=10 psy=1 psy_rd=1.00:0.15 mixed_ref=1 me_range=24 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-3 threads=24 lookahead_threads=6 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=16 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=23 scenecut=40 intra_refresh=0 rc_lookahead=250 rc=crf mbtree=1 crf=21.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
> Output #0, mp4, to ‘output.mp4':

According to "QuickTime-compatible Encoding" [1]:

  "A low quantizer (below 4) combined with 8x8 DCT Transforms produces
   garbled decode results in QuickTime Player 7.7 or earlier.
   [...]
   Just encode all your videos with --ref 4 --qpmin 4 and be safe in
   the knowledge that it will work for all Mac users".

As you can see in the console output "qpmin=0". So in ffmpegese use
"-refs 4 -qmin 4" or possibly via the "-x264-params" option if you
prefer.

[1] <http://mewiki.project357.com/wiki/X264_Encoding_Suggestions#QuickTime-compatible_Encoding>


More information about the ffmpeg-user mailing list