{"record":{"id":"16afe61fc953a335","repo":"tonhowtf/omniget","slug":"ffmpeg-mix-falhou","errorCode":null,"errorMessage":"ffmpeg (mix) falhou: {}","messagePattern":"ffmpeg \\(mix\\) falhou: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/dub.rs","lineNumber":173,"sourceCode":"            labels.push_str(&format!(\"[a{j}]\"));\n        }\n        filter.push_str(&format!(\n            \"{}amix=inputs={}:dropout_transition=0:normalize=0[out]\",\n            labels,\n            group.len()\n        ));\n        cmd.args([\n            \"-filter_complex\",\n            &filter,\n            \"-map\",\n            \"[out]\",\n            \"-c:a\",\n            \"pcm_s16le\",\n        ])\n        .arg(&out);\n        let output = cmd.output().await?;\n        if !output.status.success() {\n            return Err(anyhow!(\n                \"ffmpeg (mix) falhou: {}\",\n                String::from_utf8_lossy(&output.stderr).trim()\n            ));\n        }\n        group_files.push(out);\n    }\n    let dub_audio = out_dir.join(format!(\"{}.dub.m4a\", stem));\n    {\n        let mut cmd = crate::core::process::command(&ffmpeg);\n        cmd.args([\"-y\", \"-hide_banner\", \"-loglevel\", \"error\"]);\n        for g in &group_files {\n            cmd.arg(\"-i\").arg(g);\n        }\n        let mut filter = String::new();\n        for j in 0..group_files.len() {\n            filter.push_str(&format!(\"[{j}:a]\"));\n        }\n        filter.push_str(&format!(","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/dub.rs#L155-L191","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"let ffmpeg = which::which(\"ffmpeg\")?; // or check ensure_ffmpeg()\nlet status = tokio::process::Command::new(&ffmpeg).arg(\"-version\").output().await?;\nif !status.status.success() {\n    anyhow::bail!(\"ffmpeg is present but not executable/functional\");\n}","typeGuard":null,"tryCatchPattern":"match dub(opts).await {\n    Err(e) if e.to_string().starts_with(\"ffmpeg (mix) falhou\") => {\n        log::error!(\"mix step failed: {e}\"); // stderr is embedded; surface it to the user\n    }\n    other => other?,\n}","preventionTips":["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."],"tags":["ffmpeg","external-process","audio-mixing","dub"],"backgroundTag":"command-not-found","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}