{"record":{"id":"ce996d87b5a699e6","repo":"tonhowtf/omniget","slug":"o-ffmpeg-terminou-sem-escrever-nada","errorCode":null,"errorMessage":"o FFmpeg terminou sem escrever nada","messagePattern":"o FFmpeg terminou sem escrever nada","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/src/platforms/bilibili/danmaku/burn.rs","lineNumber":226,"sourceCode":"            progress,\n            ID,\n            \"progress\",\n            1,\n            Some(3),\n            Some(\"queimando\".into()),\n        );\n        let common = crf_args(opts.crf, &opts.preset);\n        let mut tail = audio;\n        tail.extend([\"-movflags\".into(), \"+faststart\".into()]);\n        tail.push(output.to_string_lossy().to_string());\n        run_ffmpeg(&ffmpeg, &video, &cut, &filters, &common, None, &tail).await?;\n        (0, 0)\n    };\n\n    let _ = std::fs::remove_file(&work);\n    let bytes = std::fs::metadata(&output).map(|m| m.len()).unwrap_or(0);\n    if bytes == 0 {\n        return Err(anyhow!(\"o FFmpeg terminou sem escrever nada\"));\n    }\n    report(progress, ID, \"done\", 3, Some(3), None);\n    Ok(BurnResult {\n        output: output.to_string_lossy().to_string(),\n        bytes,\n        duration_secs: window,\n        dialogues,\n        video_kbps: result.0,\n        audio_kbps: result.1,\n    })\n}\n\n// ── Montagem do comando ────────────────────────────────────────────────\n\nfn null_sink() -> &'static str {\n    if cfg!(windows) {\n        \"NUL\"\n    } else {","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/src/platforms/bilibili/danmaku/burn.rs#L208-L244","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check free disk space on the output and temp directories","Inspect the ffmpeg log captured by run_ffmpeg (the log arg) for filter or I/O warnings","Verify the output directory exists and is writable before calling run","Confirm the installed ffmpeg supports the subtitles/ass filter (ffmpeg -filters | grep subtitles)"],"exampleFix":"// before\nburn::run(&BurnOptions { output: \"/tmp/out.mp4\".into(), ..opts })\n// after\nlet out = \"/tmp/out.mp4\";\nanyhow::ensure!(\n    std::path::Path::new(out).parent().map_or(false, |p| p.is_dir()),\n    \"diretório de saída inexistente\"\n);\n// and check df / free space for the temp_dir() used by burn\nburn::run(&BurnOptions { output: out.into(), ..opts })","handlingStrategy":"try-catch","validationCode":"// before burning\nensure!(free_space(temp_dir()) > target_bytes * 2, \"pouco espaço em disco\");\nensure!(output.parent().map_or(false, |p| p.is_dir()), \"diretório de saída inexistente\");","typeGuard":null,"tryCatchPattern":"match burn::run(&opts, &progress).await {\n    Err(e) if e.to_string().contains(\"sem escrever nada\") => inspect_ffmpeg_log_and_retry(),\n    Err(e) => propagate(e)?,\n    Ok(res) => use_result(res),\n}","preventionTips":["Check free disk space before long encodes","Ensure the ffmpeg build includes the subtitles/ass filter","Keep and inspect the ffmpeg log file on any failure"],"tags":["ffmpeg","empty-output","disk","io"],"backgroundTag":"empty-output-file","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}