tonhowtf/omniget · error
ffmpeg (mix) falhou
Error message
ffmpeg (mix) falhou: {} What it means
During dubbing, per-language-group audio tracks are mixed with ffmpeg (concat/mix into pcm_s16le WAV). If the ffmpeg process exits with a non-zero status, dub() wraps the trimmed stderr into this error 'ffmpeg (mix) falhou: <stderr>'. It is thrown whenever the external ffmpeg binary cannot complete the mix step.
Solutions
- Read the stderr captured in the error message — it names the exact ffmpeg failure (missing input, unknown option, codec issue).
- Confirm ffmpeg is installed and recent (ffmpeg -version); install a full build with common codecs (e.g. distro 'ffmpeg' full package) and ensure crate::core::dependencies::ensure_ffmpeg resolved to it.
- Check free disk space and that the temp work directory (super::temp_dir()/dub-<uuid>) is writable and was not cleaned mid-run.
- Verify each input segment produced by earlier steps is a valid non-empty audio file (ffprobe it) before the mix.
Defensive patterns
Strategy: try-catch
Validate before calling
let ffmpeg = which::which("ffmpeg")?; // or check ensure_ffmpeg()
let status = tokio::process::Command::new(&ffmpeg).arg("-version").output().await?;
if !status.status.success() {
anyhow::bail!("ffmpeg is present but not executable/functional");
} Try / catch
match dub(opts).await {
Err(e) if e.to_string().starts_with("ffmpeg (mix) falhou") => {
log::error!("mix step failed: {e}"); // stderr is embedded; surface it to the user
}
other => other?,
} Prevention
- Pre-check ffmpeg availability and version (ensure_ffmpeg) before starting the pipeline.
- Keep enough free disk space for intermediate WAV files in the temp dir.
- Cleanly fail fast: if any per-cue TTS segment fails, abort before reaching the mix.
- Log the full ffmpeg command line to reproduce mix failures easily.
When it happens
Trigger: Running dub where the ffmpeg mix invocation (args ending in -c:a pcm_s16le) exits non-zero: bad/missing input segments, malformed audio arguments, an ffmpeg build lacking a required encoder/filter, or corrupted intermediate audio files in the temp work dir.
Common situations: System ffmpeg too old or built without needed codecs/filters; disk full preventing the temp WAV from being written; a previous pipeline step produced zero/short audio segments; locale-corrupted filenames with spaces/unicode passed unquoted.
Related errors
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/16afe61fc953a335.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/core/tools/dub.rs:173
labels.push_str(&format!("[a{j}]"));
}
filter.push_str(&format!(
"{}amix=inputs={}:dropout_transition=0:normalize=0[out]",
labels,
group.len()
));
cmd.args([
"-filter_complex",
&filter,
"-map",
"[out]",
"-c:a",
"pcm_s16le",
])
.arg(&out);
let output = cmd.output().await?;
if !output.status.success() {
return Err(anyhow!(
"ffmpeg (mix) falhou: {}",
String::from_utf8_lossy(&output.stderr).trim()
));
}
group_files.push(out);
}
let dub_audio = out_dir.join(format!("{}.dub.m4a", stem));
{
let mut cmd = crate::core::process::command(&ffmpeg);
cmd.args(["-y", "-hide_banner", "-loglevel", "error"]);
for g in &group_files {
cmd.arg("-i").arg(g);
}
let mut filter = String::new();
for j in 0..group_files.len() {
filter.push_str(&format!("[{j}:a]"));
}
filter.push_str(&format!(View on GitHub (pinned to 8600b91f42)