Struct ffmpeg_the_third::util::frame::Frame
source · 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 108)
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
fn receive_and_process_decoded_frames(
&mut self,
octx: &mut format::context::Output,
ost_time_base: Rational,
) {
let mut frame = frame::Video::empty();
while self.decoder.receive_frame(&mut frame).is_ok() {
self.frame_count += 1;
let timestamp = frame.timestamp();
self.log_progress(f64::from(
Rational(timestamp.unwrap_or(0) as i32, 1) * self.decoder.time_base(),
));
frame.set_pts(timestamp);
frame.set_kind(picture::Type::None);
self.send_frame_to_encoder(&frame);
self.receive_and_process_encoded_packets(octx, ost_time_base);
}
}
sourcepub fn timestamp(&self) -> Option<i64>
pub fn timestamp(&self) -> Option<i64>
Examples found in repository?
More examples
examples/transcode-x264.rs (line 104)
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
fn receive_and_process_decoded_frames(
&mut self,
octx: &mut format::context::Output,
ost_time_base: Rational,
) {
let mut frame = frame::Video::empty();
while self.decoder.receive_frame(&mut frame).is_ok() {
self.frame_count += 1;
let timestamp = frame.timestamp();
self.log_progress(f64::from(
Rational(timestamp.unwrap_or(0) as i32, 1) * self.decoder.time_base(),
));
frame.set_pts(timestamp);
frame.set_kind(picture::Type::None);
self.send_frame_to_encoder(&frame);
self.receive_and_process_encoded_packets(octx, ost_time_base);
}
}