{"record":{"id":"f4a391eece9e5584","repo":"tonhowtf/omniget","slug":"detec-o-de-tremor","errorCode":null,"errorMessage":"detecção de tremor: {}","messagePattern":"detecção de tremor: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/video_restore.rs","lineNumber":177,"sourceCode":"    if opts.stabilize {\n        let dir = std::env::temp_dir().join(format!(\"omniget-vidstab-{}\", uuid::Uuid::new_v4()));\n        std::fs::create_dir_all(&dir)?;\n        let file = dir.join(\"transforms.trf\");\n        let detect = format!(\n            \"{}:result='{}'\",\n            detect_filter(opts.shakiness),\n            file.to_string_lossy().replace('\\\\', \"/\")\n        );\n        let out = crate::core::process::command(ffmpeg)\n            .args([\"-y\", \"-hide_banner\", \"-loglevel\", \"error\", \"-i\"])\n            .arg(inp)\n            .args([\"-vf\", &detect, \"-an\", \"-f\", \"null\", \"-\"])\n            .output()\n            .await\n            .map_err(|e| anyhow!(\"ffmpeg nao iniciou: {}\", e))?;\n        if !out.status.success() {\n            let _ = std::fs::remove_dir_all(&dir);\n            return Err(anyhow!(\n                \"detecção de tremor: {}\",\n                String::from_utf8_lossy(&out.stderr).trim()\n            ));\n        }\n        trf = Some(file);\n    }\n\n    let mut chain_parts: Vec<String> = Vec::new();\n    if let Some(file) = trf.as_ref() {\n        chain_parts.push(format!(\n            \"vidstabtransform=input='{}':{}\",\n            file.to_string_lossy().replace('\\\\', \"/\"),\n            transform_filter(opts.smoothing).trim_start_matches(\"vidstabtransform=\")\n        ));\n    }\n    if let Some(c) = chain {\n        chain_parts.push(c);\n    }","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/video_restore.rs#L159-L195","documentation":"Raised in restore_one after the ffmpeg shake-detection pass exits with a non-zero status (video_restore.rs:177). ffmpeg DID start; it failed while running the vidstab detect filter (`-vf <detect> -an -f null -`). The message embeds ffmpeg's trimmed stderr, which carries the actual decode/filter error. The temp work dir is removed before returning.","triggerScenarios":"The detect pass `ffmpeg -i <input> -vf <detect> -an -f null -` exits non-zero: corrupt/unreadable input file, unsupported codec/container, or invalid vidstab detect filter arguments.","commonSituations":"User selects a damaged or partially downloaded video file for restore; input uses a codec the installed ffmpeg build cannot decode (no libX decoder); ffmpeg version too old for the vidstab filter options generated.","solutions":["Read the stderr text after 'detecção de tremor:' — it names the exact ffmpeg failure (decode error, unknown filter, bad option).","Verify the input plays with `ffprobe <input>`; re-download or repair the source file if it is corrupt.","Confirm the installed ffmpeg includes the vidstab filters (`ffmpeg -filters | grep vidstab`); upgrade or install an ffmpeg built with libvidstab.","Retry the restore; transient I/O errors on the source file can also cause a non-zero exit."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let probe = crate::core::process::command(\"ffprobe\")\n    .args([\"-v\", \"error\", \"-selectStreams\", \"v:0\", \"-show_entries\", \"stream=codec_name\", \"-of\", \"csv=p=0\", inp])\n    .output()\n    .await?;\nif !probe.status.success() {\n    return Err(anyhow!(\"arquivo de vídeo ilegível: {}\", String::from_utf8_lossy(&probe.stderr)));\n}","typeGuard":null,"tryCatchPattern":"match restore_one(input).await {\n    Err(e) if e.to_string().starts_with(\"detecção de tremor:\") => {\n        eprintln!(\"ffmpeg rejeitou o arquivo: {}\", e); // surface the embedded stderr\n    }\n    other => other?,\n}","preventionTips":["Validate input files with ffprobe before running vidstab detection","Require an ffmpeg build with libvidstab (`ffmpeg -filters | grep vidstab`) in your install docs","Reject zero-byte or obviously truncated files before the pipeline"],"tags":["ffmpeg","vidstab","video-restore","external-process"],"backgroundTag":"http-error-response","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"}