Skip to main content

open_codec_context

Function open_codec_context 

Source
pub fn open_codec_context(
    context: &mut AVCodecContext,
    options: AVDictionary,
) -> Result<Option<AVDictionary>, RsmpegError>
Expand description

Opens context with options, returning what FFmpeg did not consume.

avcodec_open2 frees the dictionary and writes the remainder back on failure as well as success. rsmpeg’s AVCodecContext::open double-frees it on failure, which would abort an encoder fallback.

§Errors

Returns the FFmpeg status when the encoder or decoder cannot be opened.