Skip to main content

Overview

Hardware-accelerated video encoding uses your GPU instead of CPU to encode video, providing:
  • 8-15x faster encoding compared to software encoders
  • Lower CPU usage (typically 10-20% vs 80-100%)
  • Lower power consumption and heat generation
  • Real-time encoding of high-resolution video (4K+)
node-webcodecs supports hardware acceleration on all major platforms through FFmpeg’s hardware encoder backends.

Platform Support

macOS

VideoToolbox
  • M-series: Exceptional performance
  • Intel Macs: Good performance
  • Supports H.264, HEVC, ProRes

Windows / Linux

NVIDIA NVENC
  • GeForce GTX 600+
  • Quadro, Tesla GPUs
  • Supports H.264, HEVC

Intel Systems

Intel QuickSync
  • 2nd gen Core+ (Sandy Bridge+)
  • Supports H.264, HEVC, VP9, AV1

AMD GPUs

AMD VCE/VCN
  • Radeon HD 7000+
  • Supports H.264, HEVC

Raspberry Pi

V4L2 M2M
  • Pi 4, Pi 5
  • H.264 encoding

Quick Start

macOS (VideoToolbox)

Windows / Linux (NVIDIA NVENC)

Intel QuickSync (All Platforms)

Hardware Encoder Codecs

H.264 Hardware Encoders

HEVC (H.265) Hardware Encoders

Other Hardware Codecs

Detecting Hardware Support

Always check if hardware acceleration is available before using it:
Example Output (M1 Mac):

Graceful Fallback

Always provide a software encoder fallback:

Platform-Specific Auto-Selection

Performance Comparison

Real-world encoding performance (1080p30, M1 MacBook Pro):
Performance varies by:
  • GPU model and generation
  • Resolution and framerate
  • Encoder quality settings
  • System thermal state

Quality Settings

macOS VideoToolbox

NVIDIA NVENC

Intel QuickSync

HEVC (H.265) Hardware Encoding

HEVC provides 25-50% better compression than H.264 at the same quality:
HEVC Patent LicensingHEVC requires patent licensing fees in some jurisdictions. Ensure you have proper licensing before distributing HEVC-encoded content.Browser Support: HEVC playback is limited (Safari only on most platforms).

4K and 8K Encoding

Hardware encoders excel at high-resolution encoding:

Common Issues

Issue: “Encoder not found”

Solution: Check FFmpeg is compiled with hardware encoder support:
If missing, reinstall FFmpeg with hardware support:

Issue: Lower quality than expected

Hardware encoders optimize for speed. For higher quality:

Issue: Encoding fails on some resolutions

Some hardware encoders require dimensions to be multiples of 16 or 32:

Best Practices

Never assume hardware encoder availability.
Higher bitrates improve quality on hardware encoders.
Ensure GPU encoding is actually being used.
Hardware encoding generates heat. For sustained encoding:
  • Monitor system temperature
  • Reduce framerate if overheating
  • Consider reducing resolution
  • Add cooling if needed for production systems

Next Steps

HDR Encoding

Hardware-accelerated HDR video

Worker Threads

Parallel encoding with multiple GPUs

API Reference

Complete encoder documentation

Real-World Examples

Production encoding pipelines