pub struct Frame { /* private fields */ }
Implementations§
Source§impl Frame
impl Frame
pub fn is_key(&self) -> bool
pub fn is_corrupt(&self) -> bool
pub fn packet(&self) -> Packet
pub fn pts(&self) -> Option<i64>
Sourcepub fn set_pts(&mut self, value: Option<i64>)
pub fn set_pts(&mut self, value: Option<i64>)
Examples found in repository?
More examples
examples/transcode-x264.rs (line 106)
94 fn receive_and_process_decoded_frames(
95 &mut self,
96 octx: &mut format::context::Output,
97 ost_time_base: Rational,
98 ) {
99 let mut frame = frame::Video::empty();
100 while self.decoder.receive_frame(&mut frame).is_ok() {
101 self.frame_count += 1;
102 let timestamp = frame.timestamp();
103 self.log_progress(f64::from(
104 Rational(timestamp.unwrap_or(0) as i32, 1) * self.decoder.time_base(),
105 ));
106 frame.set_pts(timestamp);
107 frame.set_kind(picture::Type::None);
108 self.send_frame_to_encoder(&frame);
109 self.receive_and_process_encoded_packets(octx, ost_time_base);
110 }
111 }
Sourcepub fn timestamp(&self) -> Option<i64>
pub fn timestamp(&self) -> Option<i64>
Examples found in repository?
More examples
examples/transcode-x264.rs (line 102)
94 fn receive_and_process_decoded_frames(
95 &mut self,
96 octx: &mut format::context::Output,
97 ost_time_base: Rational,
98 ) {
99 let mut frame = frame::Video::empty();
100 while self.decoder.receive_frame(&mut frame).is_ok() {
101 self.frame_count += 1;
102 let timestamp = frame.timestamp();
103 self.log_progress(f64::from(
104 Rational(timestamp.unwrap_or(0) as i32, 1) * self.decoder.time_base(),
105 ));
106 frame.set_pts(timestamp);
107 frame.set_kind(picture::Type::None);
108 self.send_frame_to_encoder(&frame);
109 self.receive_and_process_encoded_packets(octx, ost_time_base);
110 }
111 }
pub fn quality(&self) -> usize
pub fn flags(&self) -> Flags
pub fn metadata(&self) -> DictionaryRef<'_>
pub fn set_metadata(&mut self, value: Dictionary<'_>)
pub fn side_data(&self, kind: Type) -> Option<SideData<'_>>
pub fn new_side_data(&mut self, kind: Type, size: usize) -> Option<SideData<'_>>
pub fn remove_side_data(&mut self, kind: Type)
Trait Implementations§
impl Eq for Frame
impl Send for Frame
impl StructuralPartialEq for Frame
impl Sync for Frame
Auto Trait Implementations§
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