Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nestrilabs/nestri/llms.txt
Use this file to discover all available pages before exploring further.
nestri-server builds its GStreamer encoding pipeline from the flags described on this page. Video and audio encoding are configured independently. The server selects the best available hardware encoder for the requested codec at startup; you can override the encoder name directly if you need to pin a specific GStreamer element.
Video encoding
Codec selection
Preferred video codec. The server selects the highest-scoring encoder that supports this codec and successfully initialises.Accepted values:
h264, h265, av1Environment variable: VIDEO_CODEC| Value | Aliases accepted | Notes |
|---|---|---|
h264 | h.264, avc | Default. Widest browser support. 8-bit colour only. |
h265 | h.265, hevc, hev1 | Better compression; browser support varies. |
av1 | — | Best efficiency; Chromium-based browsers. |
Override the automatic encoder selection with a specific GStreamer element name (e.g.
vah264lpenc, nvh265enc, x264enc). The named element must exist in the GStreamer registry.Environment variable: VIDEO_ENCODERConstrain encoder selection to
hardware or software. When set to hardware, only elements whose GStreamer klass metadata contains /hardware are considered.Environment variable: VIDEO_ENCODER_TYPERate control
Rate control method for the video encoder.Accepted values:
cbr, vbr, cqpEnvironment variable: VIDEO_RATE_CONTROLCBR — Constant Bitrate
CBR — Constant Bitrate
Encoder targets exactly
--video-bitrate kbps at all times. Produces predictable network utilisation and is the recommended mode for streaming.Uses --video-bitrate as the target; --video-bitrate-max is ignored.VBR — Variable Bitrate
VBR — Variable Bitrate
Encoder targets
--video-bitrate kbps but may burst up to --video-bitrate-max kbps on complex scenes. Typically produces better quality than CBR at the same average bitrate.CQP — Constant Quantization Parameter
CQP — Constant Quantization Parameter
Encoder targets a fixed perceptual quality level defined by
--video-cqp. Bitrate floats with scene complexity. Not bandwidth-bounded; use only on unconstrained networks.Target video bitrate in kbps. Used by CBR and VBR rate control.Environment variable:
VIDEO_BITRATEMaximum video bitrate in kbps. Used only by VBR rate control.Environment variable:
VIDEO_BITRATE_MAXConstant Quantization Parameter quality level. Lower values produce higher quality at higher bitrates. Valid range: 1–51. Used only by CQP rate control.Environment variable:
VIDEO_CQPLatency control
Tuning preset applied on top of the selected rate control mode.Accepted values:
lowest-latency, highest-qualityEnvironment variable: VIDEO_LATENCY_CONTROL| Value | Description |
|---|---|
lowest-latency | Sets encoder parameters that minimise encode-to-transmit delay. For NVENC: preset=p1, tune=ultra-low-latency, zerolatency=true. For QSV: low-latency=true, target-usage=7. For x264enc: speed-preset=ultrafast, tune=zerolatency. |
highest-quality | Allows the encoder to use lookahead frames and multi-pass encoding for better visual quality at the cost of added latency. For NVENC: preset=p7, tune=high-quality, multi-pass=two-pass, spatial-aq=true, rc-lookahead=3. |
Keyframe interval
Distance between keyframes (I-frames) in seconds. The actual GOP size sent to the encoder is
framerate × keyframe-dist-secs. Shorter intervals improve seek and recovery behaviour but increase bitrate.Environment variable: KEYFRAME_DIST_SECSBit depth
Video bit depth. Accepted values:
8, 10.Environment variable: VIDEO_BIT_DEPTH10-bit output requires all three of the following conditions to be true:--zero-copyis enabled (DMA-BUF or CUDA memory path)- The video codec is not
h264(H.264 does not support 10-bit) - The selected encoder supports 10-bit output
P010_10LE format instead of NV12.H.264 does not support 10-bit colour. If you set
--video-bit-depth 10 with --video-codec h264, the server will use 8-bit regardless.Audio encoding
nestri-server currently supports Opus as the only audio codec. The opusenc GStreamer element is used by default, with a 10 ms frame size for low latency.
Audio capture
Audio capture backend. The selected value determines which GStreamer source element is used.Accepted values:
pipewire, pulseaudio, alsaEnvironment variable: AUDIO_CAPTURE_METHOD| Value | GStreamer element | Notes |
|---|---|---|
pipewire | pipewiresrc | Default. Recommended with WirePlumber session manager. |
pulseaudio | pulsesrc | Use when PipeWire is not available. |
alsa | alsasrc | Direct ALSA access; no sound server required. |
Codec and encoder
Preferred audio codec. Currently only
opus is supported.Environment variable: AUDIO_CODECOverride the audio encoder GStreamer element name. Defaults to
opusenc. Use this if you need a custom or patched encoder element.Environment variable: AUDIO_ENCODERAudio rate control and bitrate
Rate control method for the audio encoder. Accepted values:
cbr, vbr.Environment variable: AUDIO_RATE_CONTROLCQP is not supported for audio. Setting
cqp for audio rate control will cause the server to exit with an error.Target audio bitrate in kbps. Used by both CBR and VBR rate control.Environment variable:
AUDIO_BITRATEMaximum audio bitrate in kbps. Used only by VBR rate control.Environment variable:
AUDIO_BITRATE_MAXAudio latency tuning preset. Accepted values:
lowest-latency, highest-quality. The opusenc frame size is always set to 10 ms regardless of this setting.Environment variable: AUDIO_LATENCY_CONTROLCommon configurations
- Low-latency game streaming (default)
- Higher quality (increased latency)
- AV1 with zero-copy
The default settings are optimised for interactive game streaming at 1080p/60 fps: