tonhowtf/omniget · critical · anyhow::Error
ffmpeg nao iniciou: {}
Error message
ffmpeg nao iniciou: {} What it means
In `convert_one` (sticker.rs), the sticker conversion shells out to an external `ffmpeg` binary via `crate::core::process::command(...).output().await`. If spawning the process itself fails (the error returned by `output()`), it is wrapped as "ffmpeg nao iniciou: {e}". This means ffmpeg could not be launched at all — typically because the binary does not exist, is not on PATH, or lacks execute permission. This is distinct from ffmpeg running but failing (non-zero exit), which is handled separately.
Solutions
- Install ffmpeg and ensure it is on PATH (`ffmpeg -version` must succeed in the same environment the app runs in).
- If the app bundles ffmpeg (Tauri sidecar), verify the sidecar binary exists at the resolved path and has the executable bit set.
- Check the wrapped source error (`e`) in "ffmpeg nao iniciou: {}" — NotFound means wrong path, PermissionDenied means chmod +x.
- If a custom ffmpeg path is configurable, validate it at startup (spawn `ffmpeg -version`) and fail fast with a clear setup message.
- For GUI launches on Linux/macOS, note PATH differs from the shell; use an absolute ffmpeg path instead of relying on PATH.
Example fix
// before
let out = crate::core::process::command(ffmpeg)
.args(&args)
.output()
.await
.map_err(|e| anyhow!("ffmpeg nao iniciou: {}", e))?;
// after
if !ffmpeg.exists() {
return Err(anyhow!(
"ffmpeg nao encontrado em {}; instale o ffmpeg ou ajuste o caminho",
ffmpeg.display()
));
}
let out = crate::core::process::command(ffmpeg)
.args(&args)
.output()
.await
.map_err(|e| anyhow!("ffmpeg nao iniciou: {}", e))?; Defensive patterns
Strategy: try-catch
Validate before calling
fn ffmpeg_available(cmd: &str) -> bool {
std::process::Command::new(cmd).arg("-version").output()
.map(|o| o.status.success())
.unwrap_or(false)
}
// call once at startup; abort conversion features if false Try / catch
match convert_one(&opts, input, progress).await {
Err(e) if e.to_string().starts_with("ffmpeg nao iniciou") => {
eprintln!("instale o ffmpeg ou verifique o caminho configurado");
// optionally retry with a bundled sidecar ffmpeg path
}
r => { r?; }
} Prevention
- Probe `ffmpeg -version` at app startup and degrade features gracefully
- Bundle ffmpeg as a Tauri sidecar and use its absolute path instead of PATH lookup
- Set the execute bit on bundled binaries after download/extraction
- On GUI launches (Linux/macOS) never rely on shell PATH; resolve absolute ffmpeg path
When it happens
Trigger: Calling sticker conversion on any animated/converted target when the ffmpeg executable is not installed, not found in PATH, the configured ffmpeg path is wrong, or the binary lacks the execute bit; also on platforms where `std::process::Command::output` fails for spawn reasons (e.g. fork/ENOMEM).
Common situations: Fresh machines or Docker images without ffmpeg installed; bundlers that fail to ship the sidecar ffmpeg binary with the Tauri app; PATH not containing ffmpeg when launched from a GUI session; corrupted/zero-permission ffmpeg download.
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
- {}
- FFmpeg not found in Flatpak sandbox
- Failed to run ffmpeg: {}
- Failed to parse ffprobe JSON: {}
- ffmpeg not available
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/8c70621fcaafceba.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/core/tools/sticker.rs:487
&spec,
&attempt,
bitrate,
&inp.to_string_lossy(),
&output.to_string_lossy(),
);
super::report(
progress,
ID,
"progress",
tries as u64,
None,
Some(format!("{} · q{}", stem, attempt.quality)),
);
let out = crate::core::process::command(ffmpeg)
.args(&args)
.output()
.await
.map_err(|e| anyhow!("ffmpeg nao iniciou: {}", e))?;
if !out.status.success() {
let msg = String::from_utf8_lossy(&out.stderr).trim().to_string();
// Falhar já no primeiro degrau é erro de verdade (codec ausente,
// arquivo corrompido); nos degraus seguintes já existe um arquivo
// bom na mão, então vale ficar com ele.
if best.is_none() {
return Err(anyhow!("{}", msg));
}
tracing::warn!(
"[wa-sticker] tentativa q{} falhou: {}",
attempt.quality,
msg
);
break;
}
let bytes = std::fs::metadata(&output).map(|m| m.len()).unwrap_or(0);
best = Some((bytes, attempt));
if bytes <= spec.max_bytes {View on GitHub (pinned to 8600b91f42)