tonhowtf/omniget · error

{}

Error message

{}

What it means

to_webm in switch_album.rs bails with the trimmed stderr of the ffmpeg process when converting a Nintendo Switch capture fails: ffmpeg ran (it started) but exited with a non-zero status. The raw '{}' message is whatever ffmpeg printed to stderr, so diagnostics come directly from ffmpeg.

Solutions

  1. Run the same ffmpeg command manually to read the full stderr and fix the underlying cause
  2. Verify the source capture file is intact and playable (e.g. with ffprobe)
  3. Ensure the output path/directory exists and is writable
  4. Install or update ffmpeg to a version that supports the capture's codec
  5. Note: 'ffmpeg nao iniciou' is a separate error meaning ffmpeg failed to spawn at all (e.g. not installed)

Example fix

// before
// output path's directory does not exist
let output = PathBuf::from("/nonexistent/dir/clip.webm");
// after
std::fs::create_dir_all("/nonexistent/dir")?;
let output = PathBuf::from("/nonexistent/dir/clip.webm");
Defensive patterns

Strategy: try-catch

Validate before calling

// Before conversion, verify ffmpeg is available and the input is readable
let ffmpeg_ok = tokio::process::Command::new("ffmpeg")
    .arg("-version").output().await.map(|o| o.status.success()).unwrap_or(false);
let input_ok = tokio::fs::metadata(&source).await.map(|m| m.len() > 0).unwrap_or(false);

Try / catch

match run(opts, progress).await {
    Ok(result) => handle(result),
    Err(e) => {
        let msg = e.to_string();
        if msg.contains("Invalid data") || msg.contains("moov atom not found") {
            eprintln!("capture file is corrupt: {msg}");
        } else {
            eprintln!("ffmpeg conversion failed: {msg}");
        }
    }
}

Prevention

When it happens

Trigger: Calling run -> to_webm on a Switch capture file where the spawned ffmpeg command exits non-zero, e.g. unreadable/corrupt input file, unsupported codec in the capture, invalid output path, or bad ffmpeg arguments.

Common situations: Source file is corrupt or truncated (Switch recording stopped by battery loss); ffmpeg not installed or too old to decode the capture's codec; output directory not writable; input file renamed/deleted between selection and conversion.

Understand the failure class

Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.

Related errors


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

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/games/switch_album.rs:251

            "-c:v",
            "libvpx-vp9",
            "-crf",
            "34",
            "-b:v",
            "0",
            "-row-mt",
            "1",
            "-c:a",
            "libopus",
            "-b:a",
            "96k",
        ])
        .arg(&output)
        .output()
        .await
        .map_err(|e| anyhow::anyhow!("ffmpeg nao iniciou: {}", e))?;
    if !out.status.success() {
        anyhow::bail!("{}", String::from_utf8_lossy(&out.stderr).trim());
    }
    Ok(output)
}

pub async fn run(opts: SwitchOptions, progress: ProgressFn) -> anyhow::Result<SwitchResult> {
    let source = PathBuf::from(opts.source.trim());
    if !source.is_dir() {
        anyhow::bail!("pasta de origem não encontrada: {}", source.display());
    }
    let dest_root = PathBuf::from(opts.dest.trim());
    if opts.dest.trim().is_empty() {
        anyhow::bail!("escolha a pasta da biblioteca de destino");
    }
    let move_it = opts.mode == "move";

    report(&progress, ID, "progress", 0, None, None);
    let found = collect(&source, &opts.kinds);
    let total = found.len() as u64;

View on GitHub (pinned to 8600b91f42)