Skip to main content

moq_encode_video_cut

Function moq_encode_video_cut 

Source
#[unsafe(no_mangle)]
pub extern "C" fn moq_encode_video_cut(producer: u32) -> i32
Expand description

Cut a new group at the next published frame.

Optional. The encoder already keyframes every moq_video_encoder_output.gop frames, and each of those cuts a group, so a subscriber can always join without you calling this. Reach for it only to place the boundaries yourself: aligning groups with something the encoder cannot see, such as a scene change, a source switch, or resuming after an idle gap.

The next frame is encoded as a keyframe, which closes the open group and starts a new one at it. Calling this repeatedly before that frame arrives cuts once, not several times.

Fails when the selected encoder cannot force a keyframe (a V4L2 driver without the control): nothing is queued, and groups keep falling every gop frames.