The method currently accepts `E: AsRef<ffi::AVCodecContext>` as encoder, which wrongly permits passing decoders.