Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MinGW generated executable gives "Decoder not found" on Windows 10 #123

Open
ngasull opened this issue Jan 12, 2020 · 0 comments
Open

MinGW generated executable gives "Decoder not found" on Windows 10 #123

ngasull opened this issue Jan 12, 2020 · 0 comments

Comments

@ngasull
Copy link

ngasull commented Jan 12, 2020

In short: stream.codec().decoder().video() returns error Decoder not found on Win10 through MinGW linux build with target x86_64-pc-windows-gnu.


First of all, thanks to all contributors for making such projects possible! I'll try to be concise.

This code runs well on my linux but not on Win 10 through mingw:

    ffmpeg::init()?;
    let input_path = std::env::current_dir().unwrap().join("video.mp4");
    let input_str = input_path.to_string_lossy().into_owned();
    let mut input = ffmpeg::format::input(&input_str)?;
    let (video_stream_id, mut video_decoder) = {
        let stream = input
            .streams()
            .best(ffmpeg::util::media::Type::Video)
            .ok_or(anyhow!("Failed to get video stream"))?;
        (stream.index(), stream.codec().decoder().video()?)
    };

Features (because can't find libavresample):

[dependencies.ffmpeg]
version = "^0.2.0-alpha"
default-features = false
features = ["codec", "format", "software-resampling", "software-scaling"]

The linking lib and dll are 4.2.1 and come from here: https://ffmpeg.zeranoe.com/builds/

build.rs:

use std::env;
use std::path::PathBuf;

fn main() {
    let target = env::var("TARGET").unwrap();
    if target.contains("pc-windows") {
        let manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
        let mut lib_dir = manifest_dir.clone();
        lib_dir.push("lib");
        lib_dir.push(&target);
        lib_dir.push("lib");
        println!("cargo:rustc-link-search=all={}", lib_dir.display());
    }
}

I'm trying to open this video.

Output of the exe with wine64:

0009:fixme:thread:SetThreadStackGuarantee (0x33fbf0): stub
Error: Decoder not found

I'm also having the issue on a real Windows 10 installed on dual boot. I've tried many tweaks and seemingly searched the whole internet DuckDuckGo in order to find some sort of solution with no clue. I started to have cold sweats when I realized the complex story of ffmpeg and libav and that I might have just used the wrong libs or something.

Any help is welcome, thanks a lot for reading me! 🙏

Edit: forgot to mention target = x86_64-pc-windows-gnu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant