You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on decoding a video into individual frames, and I have most everything working properly, but ffmpeg-next is only running on a single thread.
Here is the relevant part of the code:
ffmpeg::init().unwrap();
let input_path = Path::new("/path/to/video.mp4");
let mut input_context = ffmpeg::format::input(&input_path).expect("Cannot open file.");
let input_video = input_context
.streams()
.best(Type::Video)
.expect("No video stream found");
let mut video_context_decoder = ffmpeg::codec::context::Context::from_parameters(input_video.parameters())
.expect("Failed to create decoder context");
let mut video_threading_config = video_context_decoder.threading();
video_threading_config.count = 32;
video_threading_config.kind = ffmpeg::codec::threading::Type::Frame;
video_context_decoder.set_threading(video_threading_config);
debug!("Threading: {:?}", video_context_decoder.threading());
let mut video_decoder = video_context_decoder.decoder().video().expect("Failed to create video decoder");
Here is the output of the debug line:
Config { kind: None, count: 32 }
The kind being set to Frame is never set, and even though I have the thread count set to 32, it always runs single-threaded.
I have also tried setting it on the video_decoder variable, but that does not change anything.
Am I missing something here?
The text was updated successfully, but these errors were encountered:
use ffmpeg::codec::threading;
// ... more code in between ...
let mut context_decoder = ffmpeg::codec::context::Context::from_parameters(input.parameters())?;
context_decoder.set_threading(threading::Config {
kind: threading::Type::Frame,
count: threads,
// below might be needed for ffmpeg < 6.0
// safe: true
});
I am working on decoding a video into individual frames, and I have most everything working properly, but ffmpeg-next is only running on a single thread.
Here is the relevant part of the code:
Here is the output of the debug line:
The kind being set to
Frame
is never set, and even though I have the thread count set to32
, it always runs single-threaded.I have also tried setting it on the
video_decoder
variable, but that does not change anything.Am I missing something here?
The text was updated successfully, but these errors were encountered: