mirror of
https://github.com/encounter/rust-ffmpeg.git
synced 2026-07-10 21:18:39 -07:00
feat(encoder): expose framerate
This commit is contained in:
@@ -144,6 +144,18 @@ impl Encoder {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn frame_rate(&self) -> Option<Rational> {
|
||||
unsafe {
|
||||
let fr = Rational::from((*self.as_ptr()).framerate);
|
||||
if fr == Rational(0, 1) {
|
||||
None
|
||||
}
|
||||
else {
|
||||
Some(fr)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Deref for Encoder {
|
||||
|
||||
Reference in New Issue
Block a user