Zackriya-Solutions/meetily · error

FFmpeg produced an empty output file. The input may contain

Error message

FFmpeg produced an empty output file. The input may contain no audio.

What it means

ffmpeg exited 0 but produced a 0-byte WAV. The command strips video with -vn, so an input whose only streams are video (screen recordings, muted video exports) yields no audio packets and an empty PCM file. The file is structurally fine — there is simply nothing audible to transcribe. An ffprobe-style stream check before conversion is the reliable way to tell users this up front.

Source

Thrown at frontend/src-tauri/src/audio/decoder.rs:374

    if !output.status.success() {
        error!(
            "FFmpeg conversion failed (exit code: {}): {}",
            output.status, stderr_text
        );
        return Err(anyhow!(
            "FFmpeg conversion failed with exit code: {}. \
             The file may be corrupted or in an unsupported format.",
            output.status
        ));
    }

    // Verify output file exists and has content
    let output_meta = std::fs::metadata(&temp_path)
        .map_err(|e| anyhow!("FFmpeg output file not found: {}", e))?;

    if output_meta.len() == 0 {
        return Err(anyhow!(
            "FFmpeg produced an empty output file. The input may contain no audio."
        ));
    }

    if let Some(cb) = progress_callback {
        cb(100, "FFmpeg conversion complete");
    }

    info!(
        "FFmpeg conversion complete: {} bytes output",
        output_meta.len()
    );

    Ok(temp_path)
}

/// Decode an audio file (MP4, M4A, WAV, etc.) to raw samples
pub fn decode_audio_file(path: &Path) -> Result<DecodedAudio> {

View on GitHub (pinned to 0281737d87)

Solutions

  1. Confirm the input actually has an audio stream: `ffprobe <file>` or `ffmpeg -i <file>` and look for an 'Audio:' stream line.
  2. If it's video-only, there is nothing to transcribe — obtain a version with audio or enable an audio device when recording.
  3. If audio should exist, re-export from the source application.
  4. Code fix: pre-check for an audio stream before converting (see exampleFix).

Example fix

// before
if output_meta.len() == 0 {
    return Err(anyhow!("FFmpeg produced an empty output file. The input may contain no audio."));
}

// after — detect a missing audio stream before converting
let has_audio = Command::new(&ffmpeg_path)
    .args(["-i", input_str, "-map", "0:a", "-f", "null", "-"])
    .output()
    .map(|o| o.status.success())
    .unwrap_or(true);
if !has_audio {
    return Err(anyhow!("This file has no audio track — nothing to transcribe."));
}
Defensive patterns

Strategy: validation

Validate before calling

// Rust — detect an audio stream before converting
let has_audio = Command::new(&ffmpeg_path)
    .args(["-i", input_str, "-map", "0:a", "-f", "null", "-"])
    .output()
    .map(|o| o.status.success())
    .unwrap_or(true);
if !has_audio {
    return Err(anyhow!("This file has no audio track — nothing to transcribe."));
}

Prevention

When it happens

Trigger: Importing video-only MP4s/MKVs (recorder captured no audio device), containers with metadata-only or zero-length audio streams, or muted exports.

Common situations: Screen recordings made with the mic muted/disconnected, downloaded clips whose audio track was stripped, security-camera exports.

Related errors


AI-assisted analysis of Zackriya-Solutions/meetily@0281737d87 (2026-08-16). Data as JSON: /api/errors/1a52db087c914f8f. Report an issue: GitHub.