Skip to main content
qsvenc is a high-performance video encoder that leverages Intel Quick Sync Video hardware acceleration for fast video encoding.

Installation

Run directly

nix run github:spotdemo4/nur#qsvenc

Add to flake

devShells.default = pkgs.mkShell {
  packages = with pkgs.trev; [
    qsvenc
  ];
};

Usage

Basic encoding

Encode a video with default settings:
qsvenc -i input.mp4 -o output.mp4

High-quality encoding

Encode with HEVC (H.265) and high quality preset:
qsvenc -i input.mp4 -o output.mp4 -c hevc --quality best

Fast encoding

Prioritize speed over quality:
qsvenc -i input.mp4 -o output.mp4 --quality fast

Codec options

qsvenc supports multiple codecs:

H.264/AVC

qsvenc -i input.mp4 -o output.mp4 -c h264

HEVC/H.265

qsvenc -i input.mp4 -o output.mp4 -c hevc

VP9

qsvenc -i input.mp4 -o output.mp4 -c vp9

AV1 (on supported hardware)

qsvenc -i input.mp4 -o output.mp4 -c av1

Quality settings

--quality
string
Quality preset: best, higher, high, balanced, fast, faster, fastest
--cqp
integer
Constant Quality Parameter (0-51, lower is better quality)
--icq
integer
Intelligent Constant Quality (1-51, lower is better quality)
--bitrate
integer
Target bitrate in Kbps

Advanced features

Two-pass encoding

Achieve better quality with two-pass encoding:
qsvenc -i input.mp4 -o output.mp4 --bitrate 5000 --passes 2

Hardware decode

Use hardware decoding for the input:
qsvenc -i input.mp4 -o output.mp4 --hwdec

Crop and resize

qsvenc -i input.mp4 -o output.mp4 --crop 0,0,1920,1080 --output-res 1280x720

Add filters

qsvenc -i input.mp4 -o output.mp4 --vpp-deinterlace normal --vpp-denoise weak

Batch encoding

Encode multiple files:
for file in *.mp4; do
  qsvenc -i "$file" -o "encoded_${file}" -c hevc --quality high
done

Performance comparison

EncoderSpeed (fps)QualityPower Usage
qsvenc (QSV)300-500GoodLow
x264 (CPU)30-60ExcellentHigh
x265 (CPU)10-20ExcellentHigh
nvenc (NVIDIA)400-600GoodMedium
Performance varies based on CPU generation and model. Newer Intel CPUs with newer Quick Sync Video versions provide better quality and performance.

Hardware requirements

qsvenc requires:
  • Intel CPU with Quick Sync Video support (2nd gen Core or newer)
  • Intel graphics drivers
  • /dev/dri/renderD128 device access

Check QSV availability

qsvenc --check-hw

Use cases

qsvenc can encode live streams with low latency:
qsvenc -i input.ts -o output.ts -c h264 --tune 1 --low-latency
High-quality archival with HEVC:
qsvenc -i source.mov -o archive.mp4 -c hevc --quality best --icq 18
Fast preview encoding:
qsvenc -i input.mp4 -o preview.mp4 --quality fastest --bitrate 1000
For the best quality/speed balance, use --quality high with --icq 23 for HEVC encoding.
QSV requires access to Intel GPU hardware. It will not work in containers or VMs without proper device passthrough.

Build docs developers (and LLMs) love