tonhowtf/omniget · error

o ffmpeg não iniciou

Error message

o ffmpeg não iniciou: {}

What it means

ffmpeg could not be executed to run silence detection; `.output()` (spawn + wait) failed with an io::Error that is wrapped into this message. It means the silence-scan step of yt_chapters never ran, not that ffmpeg found no silence.

Solutions

  1. Install ffmpeg and verify with `ffmpeg -version`
  2. Check the path returned by ensure_ffmpeg and fix the dependency config
  3. Grant execute permission on the ffmpeg binary
  4. Ensure PATH includes ffmpeg's directory in the app's runtime environment

Example fix

// before
let out = command(ffmpeg).args(...).output().await?;
// after
if !ffmpeg.exists() {
    anyhow::bail!("ffmpeg não encontrado em {:?}", ffmpeg);
}
let out = command(ffmpeg).args(...).output().await?;
Defensive patterns

Strategy: validation

Validate before calling

if which::which("ffmpeg").is_err() { eprintln!("ffmpeg não instalado"); }

Try / catch

match run(opts, progress).await {
    Err(e) if e.to_string().starts_with("o ffmpeg não iniciou") => {
        eprintln!("instale o ffmpeg antes de detectar pausas");
    }
    other => other?,
}

Prevention

When it happens

Trigger: `detect_silence` builds an ffmpeg command ending in `-f null -` and calls `.output().await`; the OS spawn fails (binary missing, permissions, invalid path).

Common situations: ffmpeg not installed; ensure_ffmpeg resolved a stale/removed path; no execute permission; PATH differs in GUI/Tauri context vs shell.

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


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

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/yt_chapters.rs:408

    input: &Path,
    db: f64,
    min: f64,
    total: f64,
) -> anyhow::Result<Vec<Span>> {
    let out = crate::core::process::command(ffmpeg)
        .args(["-hide_banner", "-nostats", "-i"])
        .arg(input)
        .args([
            "-af",
            &format!("silencedetect=noise={}dB:d={}", db, min.max(0.05)),
            "-vn",
            "-f",
            "null",
            "-",
        ])
        .output()
        .await
        .map_err(|e| anyhow!("o ffmpeg não iniciou: {}", e))?;
    let stderr = String::from_utf8_lossy(&out.stderr).to_string();
    Ok(super::silence_cut::parse_spans(&stderr, total))
}

async fn detect_scenes(ffmpeg: &Path, input: &Path, threshold: f64) -> anyhow::Result<Vec<f64>> {
    let out = crate::core::process::command(ffmpeg)
        .args(["-hide_banner", "-nostats", "-i"])
        .arg(input)
        .args([
            "-vf",
            &format!(
                "select='gt(scene,{})',showinfo",
                threshold.clamp(0.05, 0.95)
            ),
            "-an",
            "-f",
            "null",
            "-",

View on GitHub (pinned to 8600b91f42)