rust-ffmpeg
rust-ffmpeg copied to clipboard
Panic when trying to create video decoder
OS: MacOS Big Sur 11.6.4 Rust Toolchain: stable-x86_64-apple-darwin ffmpeg: 5.0 ffmpeg-next version: 4.4.0
Error output:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ffmpeg::Error(1128613112: )'`
(that's all)
Example:
// some imports may be unused
use ffmpeg_next as ffmpeg;
use ffmpeg::format::{input, output, Pixel};
use ffmpeg::media::Type;
use ffmpeg::software::scaling::{context::Context, flag::Flags};
use ffmpeg::util::frame::video::Video;
fn main() {
let path = <absolute path to some video file (I've tested 'mp4' and 'mov' formats)>
let mut ctx = input(&path.to_string()).unwrap();
let input = ctx
.streams()
.best(Type::Video)
.unwrap();
let index = input.index();
let mut decoder = input.codec().decoder().video().unwrap(); // <-- panics on err from ::video call
}
Hi! Have you tried it with ffmpeg-next version 5.0.3? ffmpeg upstream changed the way they handle these (see how the examples look now)