diff --git a/src/codec/encoder/video.rs b/src/codec/encoder/video.rs index 1f75e0d..881a03d 100644 --- a/src/codec/encoder/video.rs +++ b/src/codec/encoder/video.rs @@ -37,6 +37,21 @@ impl Video { } } + #[inline] + pub fn open_with(mut self, options: Dictionary) -> Result { + unsafe { + let mut opts = options.disown(); + let res = avcodec_open2(self.as_mut_ptr(), ptr::null(), &mut opts); + + Dictionary::own(opts); + + match res { + 0 => Ok(Encoder(self)), + e => Err(Error::from(e)) + } + } + } + #[inline] pub fn open_as_with(mut self, codec: E, options: Dictionary) -> Result { unsafe {