tonhowtf/omniget · error

{}

Error message

{}

What it means

Raised when the ffmpeg process for animated WebP conversion fails to start or its first spawn/output step errors; the {} carries the underlying OS/process error (e.g. ffmpeg binary missing, permission denied). It fires in the webp branch of convert_one before any encoding output is produced.

Solutions

  1. Inspect the embedded stderr message — it is ffmpeg's own error (e.g. 'Invalid argument', 'Unknown encoder').
  2. Validate the input with `ffprobe <input>`; re-encode or repair unreadable sources before conversion.
  3. Check that scale/fps options are positive and that even dimensions are used for webp/gif output.
  4. Ensure the ffmpeg build includes the target encoder (`<ffmpeg> -encoders | grep -E 'gif|libwebp'`).

Example fix

// before
if !out.status.success() { return Err(anyhow!("{}", String::from_utf8_lossy(&out.stderr).trim())); }
// after
if !out.status.success() {
    let stderr = String::from_utf8_lossy(&out.stderr).trim().to_string();
    anyhow::bail!("conversao gif falhou (exit {:?}): {}", out.status.code(), stderr);
}
Defensive patterns

Strategy: try-catch

Validate before calling

let probe = crate::core::ffmpeg::probe(input).await?;
anyhow::ensure!(probe.duration_seconds > 0.0, "entrada não decodificável");
anyhow::ensure!(opts.width.unwrap_or(2) > 0 && opts.fps.unwrap_or(1.0) > 0.0, "fps/largura devem ser positivos");

Try / catch

match convert_one(...).await {
    Err(e) if !e.to_string().contains("nao iniciou") => {
        log::error!("ffmpeg stderr: {e}"); // parse decoder/encoder messages
    }
    r => r,
}

Prevention

When it happens

Trigger: The single-pass conversion (libwebp_anim or GIF with the built filter chain) fails: corrupt/undecodable input, unsupported input codec/pixel format, invalid -vf chain (e.g. bad fps/scale values), or output path not writable.

Common situations: Input video with odd dimensions or an exotic codec ffmpeg can't decode; requested fps/width producing a scale filter error (e.g. division by zero on 0-width); ffmpeg build without libwebp_anim or GIF encoder; disk full at output location.

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

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/video_gif.rs:149

    ));
    let chain = vf_chain(opts.fps, opts.width);
    let cut = cut_args(opts.start, opts.duration);

    if output_ext(&opts.format) == "webp" {
        let out = crate::core::process::command(ffmpeg)
            .args(["-y", "-hide_banner", "-loglevel", "error"])
            .args(&cut)
            .arg("-i")
            .arg(inp)
            .args(["-vf", &chain, "-c:v", "libwebp_anim", "-lossless", "0"])
            .args(["-q:v", &opts.quality.clamp(1, 100).to_string()])
            .args(["-loop", "0", "-an"])
            .arg(&output)
            .output()
            .await
            .map_err(|e| anyhow!("ffmpeg nao iniciou: {}", e))?;
        if !out.status.success() {
            return Err(anyhow!("{}", String::from_utf8_lossy(&out.stderr).trim()));
        }
    } else {
        let tmp =
            std::env::temp_dir().join(format!("omniget-palette-{}.png", uuid::Uuid::new_v4()));
        let pass1 = crate::core::process::command(ffmpeg)
            .args(["-y", "-hide_banner", "-loglevel", "error"])
            .args(&cut)
            .arg("-i")
            .arg(inp)
            .args([
                "-vf",
                &format!(
                    "{},palettegen=max_colors={}:stats_mode=diff",
                    chain,
                    opts.max_colors.clamp(4, 256)
                ),
            ])
            .arg(&tmp)

View on GitHub (pinned to 8600b91f42)