
Publishes a variadic mix of Image, VideoFrame, and AudioFrame inputs as separate live WebRTC tracks to browser subscribers, each VideoFrame sent at its own source time, so an analytics backend can show a real-time preview in a browser tab.
An analytics overlay drawn by Draw Image Overlays (OpenCV) is streamed live to the browser for a real-time monitoring view.
A vision track and a synthesised speech track are combined into one browser session as separate WebRTC tracks.
real_time is passed to the runtime as the real-time flag of every pull, so the runtime paces the delivery of the inputs to their timestamps; video frames are timed by their own timestamps either way, and with it off an input delivered faster than its source plays is sent in segments, with the frames running more than 2 s ahead dropped between them. reset_live_mode_ms paces audio only: above 0, audio is sent in real time, 10 ms at a time, and once sending falls more than that many milliseconds behind it restarts from the current moment. Every audio frame is played: audio that arrives faster than it plays, such as a sentence of speech produced at once, waits in each client's queue and plays in full, later. A source that keeps producing more than a second of audio per second therefore grows that queue, and the client's delay, without limit. At the default of -1, or any value of 0 or less, audio is sent as soon as it arrives.VideoFrame track is timed in segments. Within a segment every frame it sends is timed at its own source time plus the segment's one offset, the arrival lag of the frame that opened the segment, so the RTP timestamps the browser receives step by the source's own spacing within 1 ms (a 23.976 fps clip by 41.708 ms, a variable-timing clip by each of its own steps) through any delivery jitter or burst within the 2 s bound below. A frame that arrives before its time waits for it in the track; frames up to 2 s late, as a burst after a stall, keep their times and are handed to the encoder at up to twice the source rate (for sources slower than 5 fps, one frame per 100 ms) until the stream has caught up; frames more than 2 s late or early are dropped as the next caveat says.VideoFrame track stays near live: every frame it sends is timed at most 2 s before or after it reached the component (a frame opening a segment while earlier frames still wait, 1 ms after the previous frame's time), so the stream never runs more than 2 s behind its input, and the component never holds a frame back, so it never slows its inputs or its audio. A frame that would break that bound is dropped, never moved: one more than 2 s late is dropped while the input catches up, as the queue of a live source drains after a stall, and the frames after it are sent at their own times again once they are within 2 s; one more than 2 s early is dropped while frames before it still wait for their time. A run of dropped frames is logged when it starts, with its reason, and when it ends, with its length.VideoFrame track opens a new segment, timed from the frame's arrival (1 ms after the previous frame's time when that is later), and logs why, when a frame's timestamp is not later than the previous frame's (a source that restarted or repeated a frame); when a second frame in a row arrives more than 2 s after its time without the input catching up (a source whose own timeline fell behind, such as one that paused); when a frame's timestamp steps more than 2 s past the previous frame's and its time lies more than 2 s ahead (a source that skipped ahead); or when a frame lies more than 2 s ahead and every frame before it has reached its time (the stream was anchored on a late frame, or its input runs faster than its source plays). Each such frame moves the stream's timing by the jump, and the frames after it keep their spacing again.Image carries no timestamp, so an Image track is timed by when each frame reaches the component, at least 1 ms apart, and inherits every unevenness of the delivery; feed a VideoFrame where steady timing matters, such as a recorded session. Audio is likewise sent by arrival (paced by reset_live_mode_ms), not by any source time, so audio and video are not aligned by their timestamps.AudioFrame is sent in whole 10 ms blocks, and every sample is sent: the samples past a frame's last whole block wait for the input's next frame and go out at its front, so up to 10 ms of a frame's end waits until the next frame arrives. A frame of another sample rate or channel count first sends the waiting samples completed with silence. A frame sampled below 100 Hz or with no channel stops the worker with an error.reset_live_mode_ms above 0, every audio frame that waits to be played, unbounded while a source produces audio faster than it plays.video_max_fps caps each video track by the frames' own times with a budget: the track earns the cap's rate in frames per second of its frames' time, saves up at most a quarter second of it (at least one frame), starting full, and sends a frame only when a whole frame is saved. So a source at or below the cap loses no frame however uneven its steps, as long as no stretch from one frame to a later one holds more than the cap's rate times its length plus that quarter second (a variable-timing clip averaging 20 fps with 20 ms steps keeps every frame under the default 30 fps); a faster source keeps the cap's rate and loses the rest, and no frame is moved in time. A lower frame rate the encoder asks for under congestion (degradation_preference `resolution` or `balanced`) drops frames the same way; the tracks never scale their resolution, so the encoder lowers quality instead where it would lower resolution.stun_server WebRTC cannot use stops the worker at startup.video_codec (then AV1, VP9, H264, VP8 as fallbacks) and to set the Opus parameters from opus_fec, opus_dtx, opus_stereo, and audio_max_bitrate_kbps, and sends it once it is set. If the rewritten answer does not parse or cannot be set, the offer is refused with a ``reject`` naming the error.stun_server is set; otherwise the connection relies on host candidates and any client-side relay, and webrtc_port_range pins the local UDP port range used for ICE candidates.video_min_bitrate_kbps, video_start_bitrate_kbps, video_max_bitrate_kbps, video_max_fps, and degradation_preference. The maximum is the cap: a minimum or start above it is lowered to it, then a start below the minimum is raised to it, so setting only video_max_bitrate_kbps below the default start or minimum caps the stream there. If WebRTC still refuses these settings on a client's connection, the worker stops with WebRTC's error.live-test prerelease
Sync WebRTC at the pinned revision only (workers #1064)
Automated release