Repository navigation
svctx: --live, each NAL injected as it arrives with the producer's capture stamp - #481
Conversation
…pture stamp Default stays the replay loop (read the clip, inject forever: a stable rate histogram for a witness). --live reads records as they arrive through the shared stdin control escape, takes CAPTURE_TS for the next NAL, injects it once and ends on EOF. One stamp per NAL: its first fragment claims it (has_capture=1, capture->send from the producer's instant); later fragments measure from the read, so the per-NAL delay check holds through fragmentation. SIGINT/SIGTERM end either mode through the ordinary exit path. tests/gen_svc_nals.py becomes a producer as well as a dump: --repeat, --pace-us (flush per NAL), --capture-ts / --capture-delay via tools/precoder/stdin_ctl.py (stdlib only). The harness gains an svctx-live phase: a paced, stamping producer with the 20 ms every-10th delay. On air (8812CU -> CF-924AC witness, 20 s): svctx-live recovers the producer delay as 20.08 ms on 6.9% of stamped frames (the every-10th lands unevenly on the clip's NAL classes and fast-rate frames are lost more often than robust ones); replay-mode svctx unchanged (lat p50 133 us, 2347 frames); tests/svctx_uep_witness.sh ALL PASS (three rates on air). Closes #475. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
PR Summary by QodoAdd live, capture-stamped NAL injection to svctx
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
Code Review by Qodo
1.
|
…opped StreamTimingTx::input_ended() folds a stamp that no record followed into capture_dropped; svctx --live and streamtx call it before stream.done. A stamp-only stdin into svctx --live now reports capture_dropped:1. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
What
Follow-up #475 from the stream-timing PR. svctx pre-read a clip and replayed it, so its per-frame timing field had no producer capture (
cap=0).svctx --live: records are read as they arrive through the shared stdin control escape; aCAPTURE_TSapplies to the next NAL; each NAL is injected once; EOF ends the run. One stamp per NAL, claimed by its first fragment; later fragments measure from the read, so the per-NAL producer-delay check holds through fragmentation. The replay mode is unchanged and remains the default.tests/gen_svc_nals.pyis now a producer too:--repeat,--pace-us,--capture-ts,--capture-delay N:MS(stdlib-onlystdin_ctl.py).tests/stream_timing_onair.shgains ansvctx-livephase with the same 20 ms every-10th producer delay check as streamtx.Measured (8812CU → CF-924AC witness, 20 s)
svctx-livesvctx(replay)tests/svctx_uep_witness.shThe 6.9 % (not 10 %) delayed share is explained in
docs/stream-timing.md: the every-10th lands unevenly on the clip's NAL classes and the fast-rate enhancement frames are lost more often than the robust base frames, so the share is partly a delivery figure. The step itself is exact.Closes #475.
🤖 Generated with Claude Code