The studio composites, but nothing yet made its picture a stream or fed
its recording and replay buffer. Streamer::start_studio does both with the
smallest change to the streamer: the studio is one more capture backend,
and the packets the encoders already make are teed to the studio's outputs
where they are produced, with the frame size the recorder needs. Only the
stream codec's encoder is teed; a codec a viewer chose is never recorded.
Recording and the replay buffer must not need a live stream, so a studio's
streamer always has a sink: while no stream is attached it is one that
drops the frames after the tee. Its audio clock starts at the studio's
epoch, the clock the composite's timestamps already count from, so a
recording's audio and video start together (the test checks they do).
Outputs ask for keyframes of the layer they take only. The replay buffer
asks every two seconds while it is on: the encoders make keyframes only on
request, so without that the window could never move past the first one
and would grow for the whole session. WHIP asks once per need (start,
session up, the service's PLI) instead of on every frame until connected,
which would have made every frame a keyframe while ICE came up.
voelin_core::studio re-exports the studio, starts it from studio.scenes and
keeps the two in step both ways without echoes; studio.replay_seconds,
studio.replay_memory_mb and studio.recording_dir join the built-in keys
(with feature media). tests/studio.rs records a stream that switches scenes
live and saves a clip, and decodes both with ffmpeg: red before the switch,
blue after it, VP8 and Opus in sync.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>