Skip to content

phrame-webrtc-session — Config Reference

The authoritative field reference for a phrame-webrtc-session instance. See phrame-webrtc-session for what the service does and why it is shaped the way it is.

The four required sections are stream (which Phrame bus stream to serve), whep (where to listen), auth (the public key and audience used to verify a viewer’s token), and video (how to encode). Everything else has a default.

FieldTypeRequiredDefaultDescription
versionstringno
log_levelstringno
streamobjectyes
whepobjectyes
authobjectyes
iceobjectno
videoobjectyes
audioobjectnoOPTIONAL. Omit entirely for a video-only source: no program-audio egress thread is spawned. Present => audio egress reads vdi://<stream.id>:<audio_suffix>. Spawning it for a stream nothing writes costs 100 x 500ms of failed VDI opens per session (4 log lines each), which is why this is opt-in.
sessionobjectno
enable_test_controlsbooleannofalseExpose GET/POST /control/bitrate, which can pin the encoder bitrate and suppress BWE. For measurement runs only; default false. Still JWT-gated when enabled -- this controls exposure, not authorisation.
topologyobjectnoMaps a composited frame's input id to the TAMS flow behind it, so the per-frame identity published on the nle-frame-id data channel can name a flow rather than a bare index. Key is the PRODUCING STAGE'S INPUT-ARRAY INDEX (phrame_frame_identity.hpp: 'id is the index in inputs, INCLUDING skipped null slots'), NOT the compositor config's stream-id param -- the two coincide in comp-mv-2048.json and must not be conflated. Omit for a single-input stream: the identity list is still published with ids and media positions, only 'flow' is left empty.

Definitions

stream

FieldTypeRequiredDefaultDescription
idstringyes
video_suffixstringno
audio_suffixstringno
talkback_suffixstringno
domainstringno

whep

FieldTypeRequiredDefaultDescription
bind_addrstringno
portintegeryes

auth

FieldTypeRequiredDefaultDescription
public_key_pathstringyes
audiencestringyes
algorithmenum: ES256 · RS256no

ice

FieldTypeRequiredDefaultDescription
host_candidate_ipstringno
stun_urlstringno
udp_port_minintegerno
udp_port_maxintegerno
bind_addrstringnoLocal address to bind the ICE UDP socket to (default: host_candidate_ip). Use 0.0.0.0 behind NAT/Docker.
ice_litebooleannoRun ICE in lite mode (respond only, never initiate checks). Needed behind symmetric NAT.

video

FieldTypeRequiredDefaultDescription
bitrateintegeryes
presetstringno
gopintegerno
fpsintegeryes
h264_level_idcintegernoH.264 level_idc to advertise in profile-level-id, as the level x10 (31 = Level 3.1, 42 = Level 4.2). Must not be below what the output geometry requires or hardware decoders reject the stream and the client silently falls back to software decode. Default 42.
vbv_buffer_framesnumbernoVBV buffer size in FRAMES of budget. Absent => ABR (average bitrate only, peaks unconstrained) which is the historical behaviour. Set 1.0-2.0 to cap the instantaneous rate: bitrate alone constrains only the average, so a keyframe takes 5-15x the per-frame budget and the paced sender then meters it out while later frames queue.
constant_bitratebooleannoWith vbv_buffer_frames set, also hold the average at the target (nal-hrd=cbr) rather than only capping the peak. Both cap the peak identically; true always spends the full bitrate, false lets the average float down on easy content. Default false.
intra_refreshbooleannofalseReplace the periodic IDR with a rolling intra refresh. Removes the visible quality pulse a tightly-constrained keyframe causes under a small VBV. Trade-off: no IDR to resynchronise on after loss.

audio

OPTIONAL. Omit entirely for a video-only source: no program-audio egress thread is spawned. Present => audio egress reads vdi://<stream.id>:<audio_suffix>. Spawning it for a stream nothing writes costs 100 x 500ms of failed VDI opens per session (4 log lines each), which is why this is opt-in.

FieldTypeRequiredDefaultDescription
bitrateintegeryes

session

FieldTypeRequiredDefaultDescription
on_second_connectionenum: reject-except-same-sub · always-reject · always-preemptno