pub struct Encoder { /* private fields */ }Expand description
MPEG video recorder.
Implementations§
Source§impl Encoder
impl Encoder
Sourcepub fn new<P: AsRef<Path>>(path: P, width: usize, height: usize) -> Encoder
pub fn new<P: AsRef<Path>>(path: P, width: usize, height: usize) -> Encoder
Creates a new video recorder.
§Arguments:
path- path to the output file.width- width of the recorded video.height- height of the recorded video.
Sourcepub fn new_with_params<P: AsRef<Path>>(
path: P,
width: usize,
height: usize,
bit_rate: Option<usize>,
time_base: Option<(usize, usize)>,
gop_size: Option<usize>,
max_b_frames: Option<usize>,
pix_fmt: Option<AVPixelFormat>,
) -> Encoder
pub fn new_with_params<P: AsRef<Path>>( path: P, width: usize, height: usize, bit_rate: Option<usize>, time_base: Option<(usize, usize)>, gop_size: Option<usize>, max_b_frames: Option<usize>, pix_fmt: Option<AVPixelFormat>, ) -> Encoder
Creates a new video recorder with custom recording parameters.
§Arguments:
path- path to the output file.width- width of the recorded video.height- height of the recorded video.bit_rate- the average bit rate. Default value: 400000.time_base- this is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented. Default value: (1, 60), i-e, 60fps.gop_size- the number of pictures in a group of pictures. Default value: 10.max_b_frames- maximum number of B-frames between non-B-frames. Default value: 1.pix_fmt- pixel format. Default value:AVPixelFormat::PIX_FMT_YUV420P.
Sourcepub fn encode_rgb(
&mut self,
width: usize,
height: usize,
data: &[u8],
vertical_flip: bool,
)
pub fn encode_rgb( &mut self, width: usize, height: usize, data: &[u8], vertical_flip: bool, )
Adds a image with a RGB pixel format to the video.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Encoder
impl RefUnwindSafe for Encoder
impl !Send for Encoder
impl !Sync for Encoder
impl Unpin for Encoder
impl UnwindSafe for Encoder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more