tonhowtf/omniget · error
ffmpeg (mux) falhou
Error message
ffmpeg (mux) falhou: {} What it means
The last dub step muxes the original video stream (stream-copied) with the dubbed audio (re-encoded to aac) using ffmpeg with -map 0:v -map 1:a -shortest. If ffmpeg exits non-zero, dub() raises 'ffmpeg (mux) falhou: <stderr>'. It is thrown when video+audio cannot be combined into the final output file.
Solutions
- Read the stderr embedded in the error message — it identifies the exact mux failure (input missing, codec/container mismatch, permission).
- Verify both inputs exist and are valid: the source video and the dubbed audio from the previous (final) step.
- Make sure the output file extension matches an ffmpeg-supported container and the directory is writable, and check free disk space.
- Confirm the installed ffmpeg has the AAC encoder (ffmpeg -encoders | grep aac); upgrade ffmpeg if it is missing or the video codec cannot be copied into the target container (e.g. use mkv for unusual video codecs).
Defensive patterns
Strategy: try-catch
Validate before calling
// guard before muxing: both inputs must exist
if !video_path.as_ref().exists() {
anyhow::bail!("source video missing: {}", video_path.as_ref().display());
}
if !dub_audio.exists() {
anyhow::bail!("dubbed audio missing: {}", dub_audio.display());
} Try / catch
match dub(opts).await {
Err(e) if e.to_string().starts_with("ffmpeg (mux) falhou") => {
log::error!("mux failed: {e}");
// suggest an .mkv output when -c:v copy fails for the container
}
other => other?,
} Prevention
- Confirm the previous (final encode) step succeeded and dub_audio is a valid media file (ffprobe) before muxing.
- Match the output extension to the container and the video codec being stream-copied; prefer .mkv for exotic codecs.
- Check free disk space for the final output before starting the pipeline.
- Keep a recent full ffmpeg build with the native AAC encoder available.
When it happens
Trigger: Calling dub where the mux invocation exits non-zero: the video input and dubbed audio are missing/unreadable, stream durations/parameters are irreconcilable, the output container (e.g. mp4) rejects the audio codec, or the output path is unwritable.
Common situations: Dubbed audio produced by a failed/aborted earlier step; output filename with an extension not matching the container; disk full during the final write; ffmpeg build lacking the native AAC encoder; source video with codecs -c:v copy cannot place into the chosen container.
Related errors
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/3a4621e6c873d79e.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/core/tools/dub.rs:243
let mut cmd = crate::core::process::command(&ffmpeg);
cmd.args(["-y", "-hide_banner", "-loglevel", "error", "-i"])
.arg(video)
.arg("-i")
.arg(&dub_audio);
if opts.keep_original_volume > 0.0 {
let f = format!(
"[0:a]volume={:.2}[o];[1:a]volume=1.0[d];[o][d]amix=inputs=2:dropout_transition=0:normalize=0[a]",
opts.keep_original_volume.min(1.0)
);
cmd.args(["-filter_complex", &f, "-map", "0:v", "-map", "[a]"]);
} else {
cmd.args(["-map", "0:v", "-map", "1:a"]);
}
cmd.args(["-c:v", "copy", "-c:a", "aac", "-shortest"])
.arg(&out);
let output = cmd.output().await?;
if !output.status.success() {
return Err(anyhow!(
"ffmpeg (mux) falhou: {}",
String::from_utf8_lossy(&output.stderr).trim()
));
}
video_out = Some(out.to_string_lossy().to_string());
}
let _ = std::fs::remove_dir_all(&work);
super::report(&progress, id, "done", 1, Some(1), None);
Ok(DubResult {
audio_path: dub_audio.to_string_lossy().to_string(),
video_path: video_out,
cues: cues.len(),
sped_up,
})
}
#[cfg(test)]
mod tests {View on GitHub (pinned to 8600b91f42)