Skip to main content

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 is a Rust binary that creates a full GStreamer media pipeline, captures your Wayland display, encodes video with a hardware GPU encoder, mixes in system audio, and delivers both streams to a browser over WebRTC. The WebRTC signalling layer is handled by a custom libp2p signaller — NestriSignaller — which connects to a Nestri relay node to exchange session descriptions without a central TURN server.

GStreamer pipeline

The pipeline has two parallel branches — video and audio — that both feed into a single webrtcsink element. This sink uses Google’s public STUN server (stun.l.google.com:19302) and the NestriSignaller for WebRTC negotiation. Congestion control and retransmission are disabled to minimise latency.

Video branch

waylanddisplaysrc
  → capsfilter          (resolution, framerate, pixel format / memory type)
  → [queue]
  → [vapostproc]        (VAAPI / QSV zero-copy paths only)
  → [capsfilter]        (VA memory: NV12 or P010_10LE)
  → [videoconvert]      (non-zero-copy path only)
  → hw/sw encoder       (e.g. nvh264enc, vah264lpenc, vah264enc, x264enc …)
  → [h264parse          (config-interval=-1, for H.264)
     h265parse]         (config-interval=-1, for H.265)
  → [queue]
  → webrtcsink
waylanddisplaysrc is given the DRI render node path of the selected GPU (render-node property). When --software-render is set, the render node is explicitly set to "software" instead. The vapostproc element is inserted only for VAAPI and QSV encoders in zero-copy mode. It converts DMABuf frames to video/x-raw(memory:VAMemory) with the correct pixel format (NV12 for 8-bit, P010_10LE for 10-bit). NVENC zero-copy uses video/x-raw(memory:CUDAMemory) directly from the source, bypassing vapostproc.

Audio branch

pulsesrc / pipewiresrc / alsasrc
  → audioconvert
  → audiorate
  → capsfilter          (audio/x-raw, rate=48000, channels=2)
  → [queue]
  → opusenc             (frame-size=10 for low latency)
  → opusparse
  → [queue]
  → webrtcsink
The capsfilter forces 48 000 Hz stereo before the encoder. This prevents a quality regression when the source produces a different sample rate. The frame-size is set to 10 ms for the lowest achievable audio latency.

Supported GPU vendors and encoder APIs

nestri-server detects GPUs by scanning /sys/class/drm and reading PCI vendor IDs. Three vendor IDs are recognised:
VendorPCI IDEncoder APIGStreamer element prefix
NVIDIA0x10deNVENCnv…enc
AMD0x1002VAAPIva…enc
Intel0x8086VAAPI / QuickSync (QSV)va…enc / qsv…enc
At startup the server queries the GStreamer registry for all elements whose klass metadata contains encoder/video. It filters to the subset compatible with the detected GPUs, scores each candidate by API priority (NVENC = QSV > VAAPI > software), and picks the highest-scoring encoder that successfully reaches PLAYING state in a brief probe pipeline.

Supported video codecs

CodecFlag valueNotes
H.264 / AVCh264Default. Widest browser support. 8-bit colour only.
H.265 / HEVCh265Better compression at equivalent bitrate. Browser support varies. 10-bit with zero-copy.
AV1av1Highest efficiency. Chromium-based browsers. 10-bit with zero-copy.

Audio capture methods

MethodGStreamer elementFlag value
PipeWirepipewiresrcpipewire (default)
PulseAudiopulsesrcpulseaudio
ALSAalsasrcalsa
PipeWire is the default and recommended method. The Nestri runner containers run WirePlumber to manage the PipeWire session graph.

Explore further

GPU selection and configuration

Select a specific GPU by vendor, name, index, or device path. Covers Docker GPU passthrough and the zero-copy DMABuf/CUDA pipeline.

Video and audio encoding options

Configure codecs, bitrate, rate control mode, latency preset, keyframe distance, and bit depth for video and audio.

Complete configuration reference

Full reference for every CLI flag and environment variable accepted by nestri-server, organised by section.

Runner containers

Run nestri-server inside a pre-built Steam, Heroic, or Minecraft container with GPU passthrough already configured.

Build docs developers (and LLMs) love