oa::VideoMuxer

Stateful streaming MP4 muxer for H.264/H.265 and optional PCM-S16 audio. Media payload is written as packets arrive. finalize appends the movie sample tables and closes the file. close deliberately abandons an unfinished file. Drop only releases the open file handle; it never manufactures a movie trailer or reports success.

StRust public API

Declaration

pub struct VideoMuxer { /* private fields */ }
Public Rust declaration.

Public Methods

pub fn set_h264_codec_config(&mut self, sps: &[u8], pps: &[u8]) -> Result<()>
pub fn set_h265_codec_config( &mut self, vps: &[u8], sps: &[u8], pps: &[u8], ) -> Result<()>
pub fn write_packet(&mut self, packet: &EncodedVideoPacket) -> Result<()>
pub fn write_audio_packet(&mut self, packet: &EncodedAudioPacket) -> Result<()>
pub fn finalize(&mut self) -> Result<()>
pub fn close(&mut self)
pub const fn config(&self) -> &VideoMuxerConfig
pub fn packet_count(&self) -> usize
pub const fn is_finalized(&self) -> bool

Associated Functions

pub fn create(path: impl AsRef<Path>, config: VideoMuxerConfig) -> Result<Self>

Public Method Documentation

pub fn set_h264_codec_config(&mut self, sps: &[u8], pps: &[u8]) -> Result<()>
No public source comment is attached to this declaration.
pub fn set_h265_codec_config( &mut self, vps: &[u8], sps: &[u8], pps: &[u8], ) -> Result<()>
No public source comment is attached to this declaration.
pub fn write_packet(&mut self, packet: &EncodedVideoPacket) -> Result<()>
No public source comment is attached to this declaration.
pub fn write_audio_packet(&mut self, packet: &EncodedAudioPacket) -> Result<()>
No public source comment is attached to this declaration.
pub fn finalize(&mut self) -> Result<()>
No public source comment is attached to this declaration.
pub fn close( &mut self )
No public source comment is attached to this declaration.
pub const fn config( &self ) -> &VideoMuxerConfig
No public source comment is attached to this declaration.
pub fn packet_count( &self ) -> usize
No public source comment is attached to this declaration.
pub const fn is_finalized( &self ) -> bool
No public source comment is attached to this declaration.
pub fn create( path: impl AsRef<Path>, config: VideoMuxerConfig ) -> Result<Self>
No public source comment is attached to this declaration.