Configure libsvtav1 for Low-Latency Live Streaming
This article provides a concise guide on configuring the SVT-AV1
(libsvtav1) encoder for ultra-low-latency live
broadcasting. It covers the essential parameter adjustments, FFmpeg
command-line configurations, and optimization strategies required to
achieve real-time AV1 encoding without sacrificing significant visual
quality.
Core Parameters for Low-Latency SVT-AV1
To achieve low-latency performance suitable for live interactive streaming, you must configure the encoder to minimize frame buffering, speed up execution times, and maintain a constant, predictable bitrate.
1. Disable Lookahead
By default, encoders analyze future frames to optimize quality, which
introduces significant latency. For live broadcasting, lookahead must be
disabled. * Parameter: lookahead=0
2. Select a Fast Preset
SVT-AV1 presets range from 0 (highest quality, slowest) to 13
(fastest). For real-time 1080p60 encoding, you should use presets
between 10 and 13 depending on your CPU capabilities. *
Parameter: -preset 10 (or higher)
3. Reduce Hierarchical Levels
SVT-AV1 uses a hierarchical GOP (Group of Pictures) structure.
Lowering the hierarchical prediction levels reduces the frame reordering
delay. Set this to 3 or lower for low latency. *
Parameter: hierarchical-levels=3 (or
2 for ultra-low latency)
4. Enable Constant Bitrate (CBR)
Live streaming networks require a predictable stream of data.
Constant Bitrate ensures the encoder does not produce massive bitrate
spikes that cause buffering. * Parameter:
rc=2 (CBR mode in SVT-AV1)
5. Disable Scene Change Detection
Disabling scene change detection prevents the encoder from inserting
unexpected keyframes, which keeps the latency and GOP structure
predictable. * Parameter: scd=0
Example FFmpeg Command
Below is a practical FFmpeg command optimized for a low-latency 1080p60 live stream using the RTMP or SRT protocol:
ffmpeg -f dshow -i video="Camera" -c:v libsvtav1 \
-preset 11 \
-g 60 \
-keyint_min 60 \
-sc_threshold 0 \
-svtav1-params tune=0:rc=2:lookahead=0:hierarchical-levels=3 \
-b:v 4000k \
-bufsize 4000k \
-pix_fmt yuv420p \
-c:a aac -b:a 128k \
-f mpegts srt://your-ingest-server:portParameter Breakdown
-preset 11: Balance of high speed and reasonable compression efficiency. If you experience dropped frames, increase this to12or13.-g 60: Sets the GOP size (keyframe interval) to 60 frames. At 60 fps, this ensures a keyframe is sent exactly every 1 second, which is critical for quick player join times.-sc_threshold 0: Disables FFmpeg’s scene change detection to maintain the strict GOP size.tune=0: Tunes the encoder for subjective visual quality.rc=2: Enforces strict Constant Bitrate (CBR).lookahead=0: Forces the encoder to compress frames immediately without waiting to analyze future frames.hierarchical-levels=3: Limits the B-frame pyramid depth, reducing the decoding delay.-b:v 4000k -bufsize 4000k: Targets a 4 Mbps video stream and sets a tight buffer size to prevent network transmission jitter.