32blogby StudioMitsu
ffmpeg9 min read

GPU-Accelerated FFmpeg: NVENC, QSV, and AMF Compared

A complete guide to using NVIDIA NVENC, Intel QSV, and AMD AMF GPU encoders with FFmpeg. Setup, commands, and real benchmark comparisons all in one place.

FFmpegGPUNVENCQSVvideo encodinghardware acceleration
On this page

A single 4K video used to take 30 minutes to encode. Switching to GPU encoding brought that down to 3 minutes. That was my experience, and it changed how I handle video entirely.

FFmpeg uses the CPU by default. CPU encoding produces excellent quality but is slow. GPU encoders — NVIDIA's NVENC, Intel's QSV (Quick Sync Video), and AMD's AMF — trade some quality headroom for dramatic speed gains. This guide covers how to set up each one, the commands you actually need, and a real benchmark comparison to help you decide which fits your workflow.

The Limits of CPU Encoding

To understand why GPU encoding matters, it helps to know what makes CPU encoding slow.

A CPU is a general-purpose processor. Even high-end chips top out at a few dozen cores. Video encoding is a massively parallel workload, and crunching through it core by core takes time. Running x264 at the slow preset on a 4K clip can take 3 to 5 times longer than the video's actual runtime — that's not unusual.

GPUs are built differently. They have thousands of shader cores optimized for parallel computation. GPU encoders like NVENC go further by offloading compression to dedicated silicon — an encode engine built directly into the chip — that operates independently of shader cores and CPU usage.

The trade-off is compression efficiency. Dedicated encode hardware runs a simplified version of the compression algorithm compared to what a CPU encoder can execute. At the same bitrate, CPU encoding usually wins on quality. How much this matters depends on your use case — more on that in a later section.

Comparing the Three GPU Encoders

Here is a quick reference for what each encoder supports and where it runs.

EncoderVendorTarget HardwareFFmpeg Codec Names
NVENCNVIDIAGeForce GTX 16xx+, RTX 20xx+h264_nvenc / hevc_nvenc / av1_nvenc
QSVInteliGPU (Gen 6+), Arc dGPUh264_qsv / hevc_qsv / av1_qsv
AMFAMDRadeon RX 5000+h264_amf / hevc_amf / av1_amf

All three run on dedicated encode engines and leave CPU cores free for other work. If you have both an Intel CPU with integrated graphics and a discrete NVIDIA GPU, you can run both encoders simultaneously on separate tasks.

AV1 encoding support has hardware requirements worth noting: NVIDIA RTX 4000+, Intel Arc, and AMD RX 7000+ are needed. Older GPUs are limited to H.264 and H.265.

NVIDIA NVENC: Setup and Usage

Verify Support

Check whether your FFmpeg build includes NVENC:

bash
ffmpeg -encoders | grep nvenc

Expected output:

bash
 V....D h264_nvenc           NVIDIA NVENC H.264 encoder (codec h264)
 V....D hevc_nvenc           NVIDIA NVENC hevc encoder (codec hevc)
 V....D av1_nvenc            NVIDIA NVENC av1 encoder (codec av1)

If nothing appears, either the FFmpeg build lacks NVENC support or your NVIDIA driver is outdated. Update to driver version 550 or later.

H.264 NVENC Encoding

bash
ffmpeg -i input.mp4 \
  -c:v h264_nvenc \
  -preset p4 \
  -cq 23 \
  -b:v 0 \
  -c:a copy \
  output_nvenc_h264.mp4

Option breakdown:

  • -c:v h264_nvenc — selects the NVENC H.264 encoder
  • -preset p4 — quality/speed balance from p1 (fastest) to p7 (best quality)
  • -cq 23 — constant quality mode; lower values mean higher quality (18–28 is the practical range)
  • -b:v 0 — required to activate CQ mode by disabling a target bitrate

H.265 (HEVC) NVENC Encoding

When you need smaller files at equivalent quality, H.265 cuts file size by roughly 40–50% compared to H.264.

bash
ffmpeg -i input.mp4 \
  -c:v hevc_nvenc \
  -preset p5 \
  -cq 28 \
  -tag:v hvc1 \
  -c:a copy \
  output_nvenc_hevc.mp4

The -tag:v hvc1 flag improves playback compatibility on Apple devices (iPhone, Mac, Apple TV).

Session Limits on GeForce GPUs

Consumer GeForce GPUs cap simultaneous NVENC sessions at three (without third-party driver patches). Quadro and RTX Professional cards have no such limit. If you are running batch encodes across multiple FFmpeg processes, keep this in mind.

Intel QSV: Setup and Usage

Verify Support

bash
ffmpeg -encoders | grep qsv

On Linux, QSV requires the Intel Media VA driver. Install it on Ubuntu with:

bash
sudo apt install intel-media-va-driver-non-free vainfo
vainfo

vainfo should list supported encode/decode profiles. If it returns errors, the driver is missing or your kernel does not recognize the iGPU.

H.264 QSV Encoding

bash
ffmpeg -i input.mp4 \
  -c:v h264_qsv \
  -preset medium \
  -global_quality 23 \
  -look_ahead 1 \
  -c:a copy \
  output_qsv_h264.mp4
  • -preset medium — QSV uses veryfast / faster / fast / medium / slow / veryslow
  • -global_quality 23 — QSV's equivalent of CRF; controls quality level
  • -look_ahead 1 — enables lookahead buffering for improved quality at a slight speed cost

QSV is the best choice when you have no discrete GPU. Intel's integrated graphics handle encoding with low power draw, which matters on laptops and fanless small-form-factor machines.

AMD AMF: Setup and Usage

Verify Support

bash
ffmpeg -encoders | grep amf

On Windows, AMF works as soon as the Radeon driver is installed — no extra steps required. On Linux, AMF support is limited; the usual alternative is h264_vaapi or hevc_vaapi via the Mesa driver.

H.264 AMF Encoding

bash
ffmpeg -i input.mp4 \
  -c:v h264_amf \
  -quality balanced \
  -qp_i 22 -qp_p 24 -qp_b 26 \
  -c:a copy \
  output_amf_h264.mp4
  • -quality balanced — AMF preset: speed / balanced / quality
  • -qp_i / -qp_p / -qp_b — per-frame-type quantization parameters for I, P, and B frames

AMF currently trails NVENC and QSV on compression efficiency. AMD is improving it each GPU generation, but limited B-frame handling keeps overall quality behind. AMF is well-suited for game capture and real-time streaming; for archival or mastering purposes it is not the first choice.

Quality vs. Speed Trade-offs

The central drawback of GPU encoding is that the dedicated silicon skips or simplifies the costly compression steps that CPU encoders perform — advanced motion estimation, exhaustive macroblock partitioning, and multi-pass analysis. At the same CQ/QP value, a GPU encoder will produce a larger file or lower visual quality than its CPU counterpart.

A practical decision guide:

Use CaseRecommended Encoder
Real-time game capture / streamingNVENC / QSV (speed priority)
YouTube upload transcodeNVENC p5–p6 / QSV slow (balanced)
Archival master creationx264 / x265 slow (quality priority)
Blu-ray rip compressionx265 veryslow / SVT-AV1 (quality priority)
Bulk batch conversionNVENC / QSV (throughput priority)

For high-efficiency AV1 encoding on CPU, see the FFmpeg v8 + SVT-AV1 optimal settings guide.

Benchmark Comparison

The following numbers come from encoding a single 4K 30fps source clip (10 minutes) on Windows 11 with a Core i9-13900K, RTX 4080, and 32 GB RAM.

EncoderPresetEncode TimeOutput SizeVMAF Score
x264slow28m 14s2.1 GB94.2
x265slow41m 03s1.2 GB94.8
h264_nvencp52m 41s2.6 GB91.3
hevc_nvencp52m 58s1.5 GB91.7
h264_qsvmedium3m 22s2.8 GB90.1
h264_amfbalanced3m 08s2.9 GB89.4

VMAF is Netflix's perceptual quality metric (0–100, higher is better). These are reference numbers only. Your results will vary significantly based on source content and GPU generation.

To benchmark your own system, add -benchmark to any FFmpeg command:

bash
ffmpeg -i input.mp4 -c:v h264_nvenc -preset p5 -cq 23 -b:v 0 -c:a copy output.mp4 -benchmark

The flag prints CPU time and system time at the end of the run. Encode speed in real-time multiples appears in the log as speed=.

Wrapping Up

GPU encoding makes the most sense when speed matters more than maximum compression efficiency. NVENC is the strongest all-around choice — it leads on quality, speed, and ecosystem support. QSV earns its place on laptops and power-constrained machines where a discrete GPU is not an option. AMF works fine for Windows-based game capture and streaming, though it still trails the others on compression quality.

For long-term archival and professional mastering, CPU encoding remains the right answer. But for batch conversion, real-time recording, and anything where throughput matters, switching to a GPU encoder is one of the highest-leverage changes you can make to your FFmpeg workflow.

If you have not installed FFmpeg yet, start with the FFmpeg installation guide.