tonhowtf/omniget · error · anyhow::Error

FFmpeg merge falhou com status

Error message

FFmpeg merge falhou com status {}

What it means

FFmpeg wrapper failure in merge_audio_video: the '-map 0:v -map 1:a -c copy' merge of separate video and audio files exited non-zero, meaning the streams could not be muxed (e.g. incompatible codecs, missing stream, or unreadable input).

Solutions

  1. Confirm both input files exist and are fully written before merging
  2. Capture ffmpeg stderr to identify which stream failed
  3. Fall back to re-encoding one stream if codec compatibility is the issue
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src-tauri/omniget-core/src/core/media_processor.rs:91 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12). Data as JSON: /api/errors/6b6af85600d52de7. Report an issue: GitHub.

Appendix: source

Thrown at src-tauri/omniget-core/src/core/media_processor.rs:91

        if !status.success() {
            anyhow::bail!("FFmpeg remux falhou com status {}", status);
        }

        Ok(())
    }

    pub async fn merge_audio_video(video: &str, audio: &str, output: &str) -> anyhow::Result<()> {
        let status = crate::core::process::command("ffmpeg")
            .args([
                "-y", "-i", video, "-i", audio, "-map", "0:v", "-map", "1:a", "-c", "copy", output,
            ])
            .stdout(std::process::Stdio::null())
            .stderr(std::process::Stdio::piped())
            .status()
            .await?;

        if !status.success() {
            anyhow::bail!("FFmpeg merge falhou com status {}", status);
        }

        Ok(())
    }

    pub async fn download_direct(
        url: &str,
        output: &str,
        headers: &[(&str, &str)],
    ) -> anyhow::Result<()> {
        let mut args = vec!["-y".to_string()];

        if !headers.is_empty() {
            let header_str: String = headers
                .iter()
                .map(|(k, v)| format!("{}: {}\r\n", k, v))
                .collect();
            args.extend(["-headers".to_string(), header_str]);

View on GitHub (pinned to 8600b91f42)