Skip to main content

Module recording_sink

Module recording_sink 

Source
Expand description

Unix-socket H.264 recording fan-out for external capture tools. Unix-socket video fan-out for external recording.

Frames are intercepted at the delivery layer (not inside each encoder), so the tap works uniformly for every full-frame encoder. The pixelflux wire header is skipped so consumers receive a plain elementary stream that is directly muxable: Annex-B for H.264 and H.265, a temporal-unit OBU stream for AV1 (each unit opened by a temporal delimiter), and IVF for VP8 and VP9, whose raw frames carry no framing of their own.

The tap must never perturb the live viewer transport, and it never copies frame bytes: stripe payloads are Arc-shared, so the encode thread only clones a handle into a bounded per-client channel drained by a dedicated writer thread. A slow or stalled recorder blocks nothing but itself and is dropped once its queue overflows. A newly connected client arms [RecordingSink::should_force_idr] so the next encode emits an IDR it can decode from.

Structsยง

RecordingSink
Unix-socket fan-out that broadcasts every encoded video frame to connected consumers.