On this page

Using the libsvtav1 Codec with Qencode

Introduction

The libsvtav1 codec is an advanced AV1 encoder optimized for both compression efficiency and parallel performance. Compared to older codecs such as libx264 (H.264), libx265 (HEVC), and libvpx (VP8/VP9), AV1 offers significantly better compression at the same visual quality, making it ideal for streaming and video-on-demand (VOD) workflows.

While AV1 encoding is generally more computationally-intensive than H.264 or VP9, the Scalable Video Technology (SVT-AV1) implementation provides excellent trade-offs via tuning parameters and presets.

Why Use libsvtav1?

  • Up to 30–40% bitrate savings compared to H.264 and 20–30% compared to HEVC or VP9 at equivalent quality.
  • AV1 is royalty-free, backed by the Alliance for Open Media.
  • Supported by modern browsers (Chrome, Firefox, Edge) and devices, making it a long-term replacement for VP9 and H.264.
  • Wide range of preset values (0–13) lets you balance speed vs. compression efficiency depending on workload.

Comparing Codecs

CodecCompression EfficiencySpeedBest For
libx264 (H.264)Baseline, fastest to encodeVery fastCompatibility across all devices
libx265 (HEVC)~25–30% better than H.264SlowerHigh-quality VOD, 4K/HDR
libvpx (VP9)~20–30% better than H.264SlowerWeb delivery, YouTube
libsvtav1 (AV1)~30–40% better than H.264, ~20% over VP9/HEVCMedium (configurable)Modern web streaming, long-term archiving, premium VOD

Basic Usage with Qencode

Here’s a simple JSON output definition for encoding with libsvtav1:

{
  "output": "mp4",
  "video_codec": "libsvtav1",
  "quality": 35,
  "video_codec_parameters": {
    "preset": 5
  }
}
  • output: Can be "mp4" or "webm" when using AV1.
  • quality: In Qencode, this corresponds to CRF (Constant Rate Factor). Lower values = higher quality & bitrate. Typical range: 20–40.
  • preset: Controls speed vs. efficiency. Default = 5 (balanced).

Advanced Parameters

In addition to preset, you can fine-tune encoding with advanced controls:

  • tune: Optimize for perceptual quality vs. performance.
  • aq_mode: Adaptive quantization for improved texture quality.
  • film_grain: Add synthetic grain for cinematic content.
  • fast_decode: Lower decoding complexity for weak devices.
  • enable_dlf / enable_restoration: Control filtering for artifact reduction.
  • hierarchical_levels / pred_struct: Influence prediction structure for quality vs. latency trade-offs.

Example Scenarios

1. High-Quality VOD (Archival or Premium Streaming)

Prioritizes efficiency and visual fidelity over speed.

{
  "output": "mp4",
  "video_codec": "libsvtav1",
  "quality": 28,
  "video_codec_parameters": {
    "preset": 3,
    "tune": 1,
    "aq_mode": 3,
    "film_grain": 0,
    "fast_decode": 0,
    "enable_dlf": 1,
    "enable_restoration": 1,
    "hierarchical_levels": 3,
    "pred_struct": 2
  }
}
  • Preset 3 ensures higher efficiency.
  • AQ mode 3 for best perceptual quality.
  • Suitable for 4K HDR, cinematic archives.

2. Fast Encoding for Quick Turnaround VOD

Favors speed and low delay over maximum compression.

{
  "output": "webm",
  "video_codec": "libsvtav1",
  "quality": 35,
  "video_codec_parameters": {
    "preset": 8,
    "tune": 2,
    "aq_mode": 0,
    "film_grain": 0,
    "fast_decode": 1,
    "enable_dlf": 0,
    "enable_restoration": 0,
    "hierarchical_levels": 1,
    "pred_struct": 0
  }
}
  • Preset 8 ensures much faster encoding, reducing turnaround time.
  • Simplified prediction structure (hierarchical_levels=1, pred_struct=0) keeps encoding complexity low.
  • Fast decode enabled makes the files easier to play on lower-power devices.
  • Recommended when speed-to-publish is more important than maximum compression efficiency.

3. Web Delivery (Balanced VOD for Browser Playback)

Balanced settings for general-purpose streaming.

{
  "output": "mp4",
  "video_codec": "libsvtav1",
  "quality": 32,
  "video_codec_parameters": {
    "preset": 5,
    "tune": 1,
    "aq_mode": 1,
    "film_grain": 0,
    "fast_decode": 0,
    "enable_dlf": 1,
    "enable_restoration": 1,
    "hierarchical_levels": 2,
    "pred_struct": 2
  }
}
  • Preset 5 balances speed and compression.
  • AQ mode 1 gives reasonable perceptual improvements without high encoding cost.
  • Fast decode enabled makes the files easier to play on lower-power devices.
  • Suitable for general streaming services.

Best Practices

  • Start with preset=5 for most workflows. Adjust downward (0–4) if you want higher efficiency, or upward (6–13) for speed.
  • CRF ~30–35 is a good baseline for web streaming. Use lower values for mastering/archival.
  • Enable restoration filters for low-bitrate scenarios to improve subjective quality.
  • Use fast_decode=1 if targeting low-power devices (set-top boxes, budget phones).

Need More Help?

For additional information, tutorials, or support, visit the Qencode Documentation pageLink or contact Qencode Support at support@qencode.com.