Zackriya-Solutions/meetily · error

Failed to wait for ffmpeg process: {}

Error message

Failed to wait for ffmpeg process: {}

What it means

The ffmpeg child was spawned successfully, but wait_with_output() failed while reaping the process or reading its piped stdout/stderr. This is a rare OS-level condition rather than a media problem: the process was killed externally (OOM killer, task manager), or the pipe was torn down before it could be drained. Usually transient; a single retry typically succeeds.

Source

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

    // Hide console window on Windows
    #[cfg(target_os = "windows")]
    {
        use std::os::windows::process::CommandExt;
        const CREATE_NO_WINDOW: u32 = 0x08000000;
        command.creation_flags(CREATE_NO_WINDOW);
    }

    debug!("FFmpeg conversion command: {:?}", command);

    #[allow(clippy::zombie_processes)]
    let child = command
        .spawn()
        .map_err(|e| anyhow!("Failed to spawn ffmpeg process: {}", e))?;

    let output = child
        .wait_with_output()
        .map_err(|e| anyhow!("Failed to wait for ffmpeg process: {}", e))?;

    let stderr_text = String::from_utf8_lossy(&output.stderr);
    debug!("FFmpeg stderr: {}", stderr_text);

    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)

View on GitHub (pinned to 0281737d87)

Solutions

  1. Retry the import once — wait failures are usually transient.
  2. Check system logs (dmesg / Event Viewer) for OOM kills if ffmpeg dies on large files; free memory or avoid parallel imports.
  3. If it persists, run the equivalent ffmpeg command manually (`ffmpeg -i <input> -vn -acodec pcm_s16le out.wav`) to see whether the process itself is unstable on this machine.
Defensive patterns

Strategy: retry

Try / catch

// caller: wait failures are typically transient — retry once
let result = convert_to_wav_with_ffmpeg(&path, None);
if let Err(e) = &result {
    if e.to_string().contains("Failed to wait for ffmpeg") {
        result = convert_to_wav_with_ffmpeg(&path, None);
    }
}

Prevention

When it happens

Trigger: System OOM killer terminates ffmpeg mid-conversion of a large file; user or a process-cleanup utility kills the child; broken pipe when stdout/stderr buffers are closed prematurely.

Common situations: Memory-constrained machines converting long recordings; force-killing the app mid-import leaves a child in an unreapable state on some platforms.

Related errors


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