[FFmpeg-user] Low quality when using GPU (h264_videotoolbox) to create mp4s

MediaMouth communque at gmail.com
Fri Feb 21 21:57:54 EET 2020


For some reason ffmpeg code I've been using successfully seems to no longer work (or I somehow I accidentally changed something and didn't realize it)

The results of using the command below produces very low quality results.  The same command run w/o h264_videotoolbox works fine, albeit considerably slower.

The stdout seems to suggest the issue is -crf vs a constant bitrate..
Codec AVOption crf (Select the quality for constant quality mode) specified for output file #0 ([DestPath]) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
but I've definitely used -crf in the past with h264_videotoolbox without an issue.

Thanks in advance.




Command:
ffmpeg -i [SrcPath] -vcodec h264_videotoolbox -crf 18 -vf format=yuv420p [DestPath]

Output: 
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with Apple clang version 11.0.0 (clang-1100.0.33.17)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.2_2 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '[SrcPath]':
  Metadata:
    major_brand     : qt  
    minor_version   : 512
    compatible_brands: qt  
    encoder         : Lavf58.29.100
  Duration: 00:05:38.64, start: 0.000000, bitrate: 66306 kb/s
    Stream #0:0(eng): Video: prores (HQ) (apch / 0x68637061), yuv422p10le(tv, bt470bg/unknown/unknown, progressive), 720x486, 64765 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn, 11988 tbc (default)
    Metadata:
      handler_name    : Apple Video Media Handler
      encoder         : Lavc58.54.100 prores_ks
    Stream #0:1(eng): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, stereo, s16, 1536 kb/s (default)
    Metadata:
      handler_name    : Apple Sound Media Handler
Codec AVOption crf (Select the quality for constant quality mode) specified for output file #0 ([DestPath]) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
Stream mapping:
  Stream #0:0 -> #0:0 (prores (native) -> h264 (h264_videotoolbox))
  Stream #0:1 -> #0:1 (pcm_s16be (native) -> aac (native))
Press [q] to stop, [?] for help
Output #0, mp4, to '[DestPath]':
  Metadata:
    major_brand     : qt  
    minor_version   : 512
    compatible_brands: qt  
    encoder         : Lavf58.29.100
    Stream #0:0(eng): Video: h264 (h264_videotoolbox) (avc1 / 0x31637661), yuv420p, 720x486, q=2-31, 200 kb/s, 29.97 fps, 11988 tbn, 29.97 tbc (default)
    Metadata:
      handler_name    : Apple Video Media Handler
      encoder         : Lavc58.54.100 h264_videotoolbox
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : Apple Sound Media Handler
      encoder         : Lavc58.54.100 aac


More information about the ffmpeg-user mailing list