tonhowtf/omniget · error

o FFmpeg terminou sem escrever nada

Error message

o FFmpeg terminou sem escrever nada

What it means

After run_ffmpeg completes, run() stats the output file and throws 'o FFmpeg terminou sem escrever nada' if the file is missing or zero bytes. FFmpeg exited successfully (or its failure was already mapped) but produced no output, indicating the encode wrote nothing.

Solutions

  1. Check free disk space on the output and temp directories
  2. Inspect the ffmpeg log captured by run_ffmpeg (the log arg) for filter or I/O warnings
  3. Verify the output directory exists and is writable before calling run
  4. Confirm the installed ffmpeg supports the subtitles/ass filter (ffmpeg -filters | grep subtitles)

Example fix

// before
burn::run(&BurnOptions { output: "/tmp/out.mp4".into(), ..opts })
// after
let out = "/tmp/out.mp4";
anyhow::ensure!(
    std::path::Path::new(out).parent().map_or(false, |p| p.is_dir()),
    "diretório de saída inexistente"
);
// and check df / free space for the temp_dir() used by burn
burn::run(&BurnOptions { output: out.into(), ..opts })
Defensive patterns

Strategy: try-catch

Validate before calling

// before burning
ensure!(free_space(temp_dir()) > target_bytes * 2, "pouco espaço em disco");
ensure!(output.parent().map_or(false, |p| p.is_dir()), "diretório de saída inexistente");

Try / catch

match burn::run(&opts, &progress).await {
    Err(e) if e.to_string().contains("sem escrever nada") => inspect_ffmpeg_log_and_retry(),
    Err(e) => propagate(e)?,
    Ok(res) => use_result(res),
}

Prevention

When it happens

Trigger: FFmpeg process finished but the output path was never created; disk full causing a 0-byte file; filter chain (danmaku subtitle filter) rejected all frames; output path unwritable yet the command still reported success.

Common situations: No space left on device; output path in a directory that was cleaned mid-run; ffmpeg build without the libass/subtitles filter silently doing nothing; work file removed but final rename never happened.

Related errors


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

Appendix: source

Thrown at src-tauri/src/platforms/bilibili/danmaku/burn.rs:226

            progress,
            ID,
            "progress",
            1,
            Some(3),
            Some("queimando".into()),
        );
        let common = crf_args(opts.crf, &opts.preset);
        let mut tail = audio;
        tail.extend(["-movflags".into(), "+faststart".into()]);
        tail.push(output.to_string_lossy().to_string());
        run_ffmpeg(&ffmpeg, &video, &cut, &filters, &common, None, &tail).await?;
        (0, 0)
    };

    let _ = std::fs::remove_file(&work);
    let bytes = std::fs::metadata(&output).map(|m| m.len()).unwrap_or(0);
    if bytes == 0 {
        return Err(anyhow!("o FFmpeg terminou sem escrever nada"));
    }
    report(progress, ID, "done", 3, Some(3), None);
    Ok(BurnResult {
        output: output.to_string_lossy().to_string(),
        bytes,
        duration_secs: window,
        dialogues,
        video_kbps: result.0,
        audio_kbps: result.1,
    })
}

// ── Montagem do comando ────────────────────────────────────────────────

fn null_sink() -> &'static str {
    if cfg!(windows) {
        "NUL"
    } else {

View on GitHub (pinned to 8600b91f42)