Skip to main content

cfr_catchup_frames

Function cfr_catchup_frames 

Source
fn cfr_catchup_frames(
    elapsed: Duration,
    frame_interval: Duration,
    pushed: u64,
    max_burst: u64,
) -> u64
Expand description

How many video frames a constant-frame-rate stream should have emitted by elapsed (at frame_interval), minus those already pushed — i.e. the number to push this tick to keep the encoder’s frame count locked to wall-clock. The live encoder timestamps frames by count at a fixed rate, so a compose pump that can’t sustain that rate must duplicate the last frame to fill the deficit, or the recording plays fast. Bounded by max_burst so a long stall can’t emit an unbounded catch-up burst.