tonhowtf/omniget · error

arquivo não encontrado

Error message

arquivo não encontrado: {}

What it means

The input media file passed to yt_chapters does not exist on disk. `run` validates `opts.input` with `input.exists()` before probing, and fails with the path embedded in the message so the user can see which file was missing.

Solutions

  1. Verify the file exists at opts.input before calling run
  2. Use absolute paths instead of relative ones
  3. Ensure the download/production step completed before running chapter detection
  4. Correct the path string (check for typos or encoding issues)

Example fix

// before
run(Options { input: "video.mp4".into(), ..Default::default() }, progress).await?;
// after
let input = "/abs/path/video.mp4";
assert!(Path::new(input).exists(), "missing input: {}", input);
run(Options { input: input.into(), ..Default::default() }, progress).await?;
Defensive patterns

Strategy: validation

Validate before calling

if !Path::new(&opts.input).exists() {
    return Err(anyhow!("arquivo não encontrado: {}", opts.input));
}

Try / catch

match run(opts, progress).await {
    Err(e) if e.to_string().starts_with("arquivo não encontrado") => {
        eprintln!("confira o caminho do vídeo de entrada");
    }
    other => other?,
}

Prevention

When it happens

Trigger: Calling `run(opts, progress)` with `opts.input` pointing to a deleted, moved, mistyped, or not-yet-downloaded file.

Common situations: Downstream step assumes the download finished but it failed; typo in the path; relative path resolved from a different working directory; file on unmounted volume.

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/a56f52ae3829efb7. Report an issue: GitHub.

Appendix: source

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

            &format!(
                "select='gt(scene,{})',showinfo",
                threshold.clamp(0.05, 0.95)
            ),
            "-an",
            "-f",
            "null",
            "-",
        ])
        .output()
        .await
        .map_err(|e| anyhow!("o ffmpeg não iniciou: {}", e))?;
    Ok(parse_scene_times(&String::from_utf8_lossy(&out.stderr)))
}

pub async fn run(opts: Options, progress: super::ProgressFn) -> anyhow::Result<ChaptersResult> {
    let input = PathBuf::from(opts.input.trim());
    if !input.exists() {
        return Err(anyhow!("arquivo não encontrado: {}", opts.input));
    }
    let ffmpeg = crate::core::dependencies::ensure_ffmpeg().await?;
    super::report(&progress, ID, "progress", 0, Some(3), None);
    let probe = crate::core::ffmpeg::probe(&input).await?;
    let total = probe.duration_seconds;
    if total <= 0.0 {
        return Err(anyhow!("não consegui medir a duração do vídeo"));
    }

    let mut cues: Vec<Cue> = Vec::new();
    if !opts.subtitle_path.trim().is_empty() {
        if let Ok(text) = std::fs::read_to_string(opts.subtitle_path.trim()) {
            cues = super::subtitle::parse(&text).unwrap_or_default();
            cues = super::yt_notes::dedup_cues(&cues);
        }
    }
    let titled = !cues.is_empty();

View on GitHub (pinned to 8600b91f42)