Skip to main content

vbv_bits

Function vbv_bits 

Source
pub fn vbv_bits(
    bitrate_bps: u32,
    fps: f64,
    keyframe_interval_s: f64,
    multiplier: f64,
) -> u32
Expand description

Size the CBR VBV/HRD buffer so rate control has enough slack to hold quality steady without letting end-to-end latency drift upward.

The size is expressed as a multiple of one frame’s bit budget (bitrate_bps / fps) rather than a fixed byte count so a live bitrate or framerate change rescales the buffer with it, preserving the same latency behavior at every operating point.

§Arguments

  • bitrate_bps - Target bitrate in bits per second.
  • fps - Target frames per second.
  • keyframe_interval_s - Seconds between scheduled keyframes; <= 0 for infinite GOP.
  • multiplier - Explicit buffer multiplier; <= 0 selects the policy default (1.5 on infinite GOP, 3 when keyframe interval is active).

§Returns

VBV buffer size in bits, clamped to [1, u32::MAX].