{"record":{"id":"4791fedb90414092","repo":"tonhowtf/omniget","slug":"v-deo-n-o-encontrado","errorCode":null,"errorMessage":"vídeo não encontrado: {}","messagePattern":"vídeo não encontrado: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/src/platforms/bilibili/danmaku/burn.rs","lineNumber":77,"sourceCode":"    \"veryfast\".into()\n}\n\n#[derive(Debug, Clone, Serialize)]\npub struct BurnResult {\n    pub output: String,\n    pub bytes: u64,\n    pub duration_secs: f64,\n    /// Quantos comentários sobraram dentro da janela.\n    pub dialogues: usize,\n    /// 0 quando a codificação foi por CRF.\n    pub video_kbps: u32,\n    pub audio_kbps: u32,\n}\n\npub async fn run(opts: &BurnOptions, progress: &ProgressFn) -> Result<BurnResult> {\n    let video = PathBuf::from(opts.video.trim());\n    if !video.is_file() {\n        return Err(anyhow!(\"vídeo não encontrado: {}\", opts.video));\n    }\n    let sub = PathBuf::from(opts.subtitle.trim());\n    if !sub.is_file() {\n        return Err(anyhow!(\"legenda não encontrada: {}\", opts.subtitle));\n    }\n    let ffmpeg = omniget_core::core::dependencies::ensure_ffmpeg().await?;\n\n    report(\n        progress,\n        ID,\n        \"progress\",\n        0,\n        Some(3),\n        Some(\"lendo o vídeo\".into()),\n    );\n    let probe = omniget_core::core::ffmpeg::probe(&video).await?;\n    let has_audio = probe.streams.iter().any(|s| s.codec_type == \"audio\");\n    let start = opts.start.max(0.0);","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/src/platforms/bilibili/danmaku/burn.rs#L59-L95","documentation":"run() validates that the configured video input path points to an existing regular file before invoking FFmpeg. If opts.video (after trimming whitespace) does not exist or is a directory, it throws 'vídeo não encontrado: <path>'. This is a fail-fast precondition for the danmaku burn pipeline.","triggerScenarios":"Calling bilibili::danmaku::burn::run with BurnOptions.video pointing to a non-existent path, an empty string, a directory, or a path that was moved/deleted after the download finished.","commonSituations":"Download step failed or was cancelled (see error 1050) so the file never landed; wrong path passed between pipeline stages; path with stray whitespace; user edited the output dir in config.","solutions":["Check the path exists before calling run: std::path::Path::new(path).is_file()","Verify the upstream download stage succeeded and record its actual output path rather than guessing it","Trim and normalize the path; check for typos or stale absolute paths from another machine"],"exampleFix":"// before\nburn::run(&BurnOptions { video: \"downloads/clip.mp4\".into(), ..opts })\n// after\nlet video = \"downloads/clip.mp4\";\nif !std::path::Path::new(video).is_file() {\n    anyhow::bail!(\"vídeo de entrada ausente: {}\", video);\n}\nburn::run(&BurnOptions { video: video.into(), ..opts })","handlingStrategy":"validation","validationCode":"fn ensure_video(path: &str) -> Result<(), String> {\n    if std::path::Path::new(path.trim()).is_file() { Ok(()) }\n    else { Err(format!(\"vídeo não encontrado: {}\", path)) }\n}","typeGuard":"fn is_existing_file(p: &str) -> bool {\n    std::path::Path::new(p.trim()).is_file()\n}","tryCatchPattern":"match burn::run(&opts, &progress).await {\n    Err(e) if e.to_string().starts_with(\"vídeo não encontrado\") => notify_user_missing_video(&opts.video),\n    Err(e) => propagate(e)?,\n    Ok(res) => use_result(res),\n}","preventionTips":["Thread the actual output path of the download stage into BurnOptions","Check is_file() on every pipeline input before invoking the next stage","Trim paths and reject empty strings early"],"tags":["file-not-found","validation","ffmpeg"],"backgroundTag":"file-not-found","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"}