Skip to content

VideoToolbox

currentMigrated from docs/encoders_hw/videotoolbox.mdx at 37c3317fd058; modified for Encode Wiki · CC BY-SA 4.0

VideoToolbox is Apple’s low-level framework for hardware video encoding and decoding on macOS and iOS. On Apple Silicon (and Macs with a T2 chip) the work runs on the media engine, which makes it fast and very efficient. FFmpeg exposes h264_videotoolbox, hevc_videotoolbox and prores_videotoolbox; HandBrake offers the same engines as its VideoToolbox H.264, H.265 and H.265 10-bit encoders.

As with every hardware encoder, you get speed and low power use at the cost of compression efficiency: x264 and x265 at slow presets give better quality at the same bitrate. VideoToolbox is a good fit for fast exports, recordings and previews, and for hardware ProRes. For archival or size-critical H.264 and HEVC encodes, use the software encoders. More in NVENC: hardware or software.

CodecFFmpeg encoderNotes
H.264h264_videotoolbox8-bit 4:2:0.
HEVChevc_videotoolbox8-bit and 10-bit (-profile:v main10 -pix_fmt p010le), alpha channel input, 4:2:2 10-bit on hardware that supports it.
ProResprores_videotoolboxProfiles proxy, lt, standard, hq, 4444, xq. Hardware ProRes needs a chip with a ProRes engine: M1 Pro, Max and Ultra, and every M2 or later chip.
AV1noneFFmpeg has no AV1 VideoToolbox encoder. Apple chips from the M3 and A17 Pro decode AV1 in hardware, but that is decode only.

On Apple Silicon Macs, -q:v sets a constant-quality target from 0 to 100, higher is better (FFmpeg enables it only in native arm64 macOS builds):

Terminal window
ffmpeg -i input.mkv -c:v hevc_videotoolbox -q:v 60 -tag:v hvc1 -c:a copy output.mp4

-tag:v hvc1 makes QuickTime, Safari and iOS accept HEVC in MP4 or MOV; without it the file carries the hev1 tag that Apple players do not recognise. The 0–100 scale is not CRF, and a good value depends on the source, so encode a short clip and look at it. 10-bit HEVC:

Terminal window
ffmpeg -i input.mkv -c:v hevc_videotoolbox -q:v 60 -profile:v main10 -pix_fmt p010le -tag:v hvc1 -c:a copy output.mp4

On Intel Macs -q:v is not available (FFmpeg stops with “-q:v qscale not available for encoder. Use -b:v bitrate instead”), so set a bitrate:

Terminal window
ffmpeg -i input.mkv -c:v h264_videotoolbox -b:v 8M -c:a copy output.mp4
Terminal window
ffmpeg -hwaccel videotoolbox -hwaccel_output_format videotoolbox_vld -i input.mkv -vf scale_vt=1920:1080 -c:v hevc_videotoolbox -q:v 60 -tag:v hvc1 output.mp4

Decode, scale and encode stay on the media engine. scale_vt is the only scaler in this path; any other filter needs hwdownload,format=nv12 first.

OptionWhat it does
-q:vQuality 0–100, Apple Silicon only.
-b:vBitrate target, used when no quality is set. -constant_bit_rate 1 asks for true CBR (macOS 13 or newer).
-profile:vH.264 baseline, main, high, constrained_high; HEVC main, main10, main42210; ProRes names above.
-allow_sw 1, -require_sw 1Permit or force Apple’s software encoder. Off by default, so a missing hardware encoder is an error, not a silent fallback.
-realtime 1Hint for live capture. Lowers latency, may cost efficiency.
-prio_speed 1Prefer speed over quality.
-power_efficient 1Ask for the lower-power path when available.
-spatial_aq 1Spatial adaptive quantization where supported.
-alpha_qualityQuality of the alpha channel in HEVC with alpha (0–1).

HandBrake can drive VideoToolbox as well. In HandBrakeCLI the encoders are vt_h264, vt_h265, vt_h265_10bit and vt_prores:

Terminal window
HandBrakeCLI -i input.mkv -o output.mp4 --encoder vt_h265 --quality 60

HandBrake’s own scaler is sharper than the VideoToolbox one, so prefer it for resizing.

  • Constant quality does not work on Intel Macs or with an x86_64 FFmpeg running under Rosetta; use a bitrate there.
  • Missing -tag:v hvc1 is the usual reason an HEVC file will not play in Apple software.
  • The hardware encoder cannot be tuned like x264/x265: there are no presets, and most encoder internals are not exposed.