tonhowtf/omniget · error · anyhow::Error

FFmpeg binary not found after extraction

Error message

FFmpeg binary not found after extraction

What it means

After downloading and extracting the FFmpeg archive, download_ffmpeg() verifies that the expected ffmpeg binary now exists at its target path. If extraction produced no file there — because the archive layout didn't match the expected inner paths or extraction skipped entries — this anyhow error is returned.

Solutions

  1. Download the archive manually and inspect its internal layout; update the extraction path matching logic to the new structure
  2. Confirm the correct archive variant for the current platform is in the downloads list
  3. Check antivirus/quarantine logs for removal of the extracted binary
  4. Re-run ensure_ffmpeg to force a fresh download and extraction

Example fix

// before
for i in 0..archive.len() {
    let mut entry = archive.by_index(i)?;
    // match only by file name
}
// after
for i in 0..archive.len() {
    let mut entry = archive.by_index(i)?;
    let name = entry.name().rsplit('/').next().unwrap_or("");
    if targets.contains(&name) { /* extract regardless of nesting */ }
}
Defensive patterns

Strategy: validation

Validate before calling

// after extraction, before trusting install
if !bin_dir.join(bin_name("ffmpeg")).exists() {
    eprintln!("extraction produced no ffmpeg binary — check archive layout");
}

Try / catch

match download_ffmpeg().await {
    Ok(p) => ...,
    Err(e) if e.to_string().contains("not found after extraction") => {
        eprintln!("archive layout changed; update extraction matching");
    }
    Err(e) => ...,
}

Prevention

When it happens

Trigger: The downloaded archive's internal directory structure differs from what extract_zip_ffmpeg/extract expects (vendor changed nesting), so the ffmpeg/ffprobe entries were never copied to bin_dir.

Common situations: Upstream FFmpeg release repackaged with different folder nesting; wrong archive type downloaded for the platform; partial/corrupt archive extracted zero entries; antivirus quarantined the extracted binary.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12). Data as JSON: /api/errors/22c029061736da3b. Report an issue: GitHub.

Appendix: source

Thrown at src-tauri/omniget-core/src/core/dependencies.rs:506

        if ffprobe_path.exists() {
            let ffprobe_mac = ffprobe_path.clone();
            if let Err(e) = tokio::task::spawn_blocking(move || {
                crate::core::process::std_command("xattr")
                    .args(["-d", "com.apple.quarantine"])
                    .arg(&ffprobe_mac)
                    .output()
            })
            .await
            .map_err(|e| std::io::Error::other(e.to_string()))
            .and_then(|r| r)
            {
                tracing::warn!("Failed to remove quarantine from ffprobe: {}", e);
            }
        }
    }

    if !ffmpeg_target.exists() {
        return Err(anyhow!("FFmpeg binary not found after extraction"));
    }

    let verify = {
        let target = ffmpeg_target.clone();
        tokio::task::spawn_blocking(move || {
            crate::core::process::std_command(&target)
                .arg("-version")
                .stdout(Stdio::null())
                .stderr(Stdio::null())
                .status()
        })
        .await
        .map_err(|e| anyhow!("spawn_blocking failed: {}", e))?
    };
    match verify {
        Ok(s) if s.success() => {}
        Ok(s) => {
            return Err(anyhow!(

View on GitHub (pinned to 8600b91f42)