{"record":{"id":"d3d5e3a3b2a579e9","repo":"tonhowtf/omniget","slug":"o-arquivo-n-o-tem-trilha-de-udio","errorCode":null,"errorMessage":"o arquivo não tem trilha de áudio","messagePattern":"o arquivo não tem trilha de áudio","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/audio_clean.rs","lineNumber":177,"sourceCode":"        .arg(input)\n        .args([\"-af\", filter, \"-f\", \"null\", \"-\"])\n        .output()\n        .await\n        .map_err(|e| anyhow!(\"ffmpeg nao iniciou: {}\", e))?;\n    let stderr = String::from_utf8_lossy(&out.stderr).to_string();\n    parse_measure(&stderr).ok_or_else(|| {\n        anyhow!(\n            \"não consegui medir o loudness: {}\",\n            stderr.lines().last().unwrap_or(\"\").trim()\n        )\n    })\n}\n\nasync fn clean_one(ffmpeg: &Path, opts: &CleanOptions, input: &str) -> anyhow::Result<CleanItem> {\n    let inp = Path::new(input);\n    let probe = crate::core::ffmpeg::probe(inp).await?;\n    if !probe.streams.iter().any(|s| s.codec_type == \"audio\") {\n        return Err(anyhow!(\"o arquivo não tem trilha de áudio\"));\n    }\n    let has_video = probe\n        .streams\n        .iter()\n        .any(|s| s.codec_type == \"video\" && s.codec_name != \"mjpeg\" && s.codec_name != \"png\");\n    let (target_i, target_tp) = target_for(&opts.target);\n\n    let mut chain: Vec<String> = Vec::new();\n    let mut measured = None;\n    if opts.mode == \"denoise\" || opts.mode == \"both\" {\n        chain.push(denoise_filter(\n            &opts.denoise_mode,\n            opts.strength,\n            (!opts.rnnn_path.trim().is_empty()).then_some(opts.rnnn_path.trim()),\n        ));\n    }\n    if opts.mode == \"loudness\" || opts.mode == \"both\" {\n        let m = measure(ffmpeg, inp, &measure_filter(target_i, target_tp)).await?;","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/audio_clean.rs#L159-L195","documentation":"clean_one probes the input with crate::core::ffmpeg::probe and rejects files that contain no audio stream with \"o arquivo não tem trilha de áudio\". Loudness normalization/denoising is meaningless without audio, so this is an explicit precondition check.","triggerScenarios":"run -> clean_one given a file whose ffprobe streams contain no codec_type == \"audio\": a video-only file, images (mjpeg/png), or a corrupted container.","commonSituations":"User points the cleaner at a video, subtitle, or image file by mistake; corrupt downloads with missing audio track; container with audio in an unsupported/undetectable format.","solutions":["Verify the input has an audio track: `ffprobe -v error -select_streams a -show_entries stream=index <file>`","Skip audio-only cleaning for such files or route them to a video workflow","Check the file is fully downloaded/not corrupt if you expected audio","Use the probe result to give the user a clearer UI-level message"],"exampleFix":"// before\nif !probe.streams.iter().any(|s| s.codec_type == \"audio\") {\n    return Err(anyhow!(\"o arquivo não tem trilha de áudio\"));\n}\n// after\nif !probe.streams.iter().any(|s| s.codec_type == \"audio\") {\n    return Err(anyhow!(\"{}: no audio stream found (codec types present: {:?}); provide a media file with audio\", input,\n        probe.streams.iter().map(|s| s.codec_type.as_str()).collect::<Vec<_>>()));\n}","handlingStrategy":"validation","validationCode":"let probe = crate::core::ffmpeg::probe(Path::new(input)).await?;\nif !probe.streams.iter().any(|s| s.codec_type == \"audio\") {\n    // skip or route to a non-audio workflow before calling clean_one\n}","typeGuard":null,"tryCatchPattern":"match run(&opts, &[input]).await {\n    Err(e) if e.to_string().contains(\"trilha de áudio\") => skip_with_warning(input),\n    other => other?,\n}","preventionTips":["Probe every input file before enqueueing it for audio cleaning","Filter out images/video-only files in the UI file picker","Treat corrupt downloads (missing streams) as a distinct user-facing error","Show ffprobe stream summary to the user on failure"],"tags":["ffmpeg","audio","validation","media","rust"],"backgroundTag":"missing-required-argument","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}