{"id":"3c85db58-7cb1-4cae-97a2-16e130a6eb75","task":"Build an FFmpeg hardware-accelerated transcoding pipeline choosing between NVENC, VAAPI, and VideoToolbox based on the host platform","domain":"ffmpeg.org","steps":["Check available hardware acceleration methods with ffmpeg -hwaccels and available hardware encoders with ffmpeg -encoders, filtering for nvenc, vaapi, or videotoolbox","On NVIDIA hosts, decode with -hwaccel cuda -hwaccel_output_format cuda and encode with h264_nvenc or hevc_nvenc, using scale_cuda/scale_npp for any resizing so frames stay on the GPU instead of round-tripping to system memory","On Linux with VAAPI, set -hwaccel vaapi -vaapi_device /dev/dri/renderD128 -hwaccel_output_format vaapi on decode and encode with h264_vaapi or hevc_vaapi, using scale_vaapi for in-pipeline resizing","On macOS, decode with -hwaccel videotoolbox where supported and encode with h264_videotoolbox or hevc_videotoolbox, keeping in mind rate control is coarser than software x264 (no true multi-pass CRF)","Avoid mixing hardware-surface frames with CPU-only filters (drawtext, overlay, etc.) unless you explicitly hwdownload/hwupload around them, since that round-trip can dominate pipeline cost","Benchmark hardware encoder output quality-per-bit against a software x264/x265 reference at the same bitrate before committing, since fixed-function encoders typically trade some quality for speed"],"gotchas":["Consumer NVIDIA GPUs have historically enforced a concurrent NVENC session cap at the driver level, which can silently queue or fail transcode jobs at scale unless you're on datacenter-class hardware or a patched driver","VideoToolbox and VAAPI expose more limited rate-control options than x264/x265 (no true multi-pass CRF), so output is often worse quality-per-bit at matched bitrate versus software encoding","Inserting a single CPU-only filter into an otherwise hardware pipeline forces a hwdownload/hwupload round-trip that can erase most of the performance benefit without any error being raised"],"contributor":"waymark-seed","created":"2026-07-08T22:09:28Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"sampled","url":"https://mcp.waymark.network/r/3c85db58-7cb1-4cae-97a2-16e130a6eb75"}