{"record":{"id":"a2bdf6241bc9ad3a","repo":"tonhowtf/omniget","slug":"sticker","errorCode":null,"errorMessage":"{}","messagePattern":"\\{\\}","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/sticker.rs","lineNumber":494,"sourceCode":"            progress,\n            ID,\n            \"progress\",\n            tries as u64,\n            None,\n            Some(format!(\"{} · q{}\", stem, attempt.quality)),\n        );\n        let out = crate::core::process::command(ffmpeg)\n            .args(&args)\n            .output()\n            .await\n            .map_err(|e| anyhow!(\"ffmpeg nao iniciou: {}\", e))?;\n        if !out.status.success() {\n            let msg = String::from_utf8_lossy(&out.stderr).trim().to_string();\n            // Falhar já no primeiro degrau é erro de verdade (codec ausente,\n            // arquivo corrompido); nos degraus seguintes já existe um arquivo\n            // bom na mão, então vale ficar com ele.\n            if best.is_none() {\n                return Err(anyhow!(\"{}\", msg));\n            }\n            tracing::warn!(\n                \"[wa-sticker] tentativa q{} falhou: {}\",\n                attempt.quality,\n                msg\n            );\n            break;\n        }\n        let bytes = std::fs::metadata(&output).map(|m| m.len()).unwrap_or(0);\n        best = Some((bytes, attempt));\n        if bytes <= spec.max_bytes {\n            break;\n        }\n    }\n\n    let (bytes, attempt) = best.ok_or_else(|| anyhow!(\"nenhuma tentativa rodou\"))?;\n    Ok(StickerItem {\n        input: input.to_string(),","sourceCodeStart":476,"sourceCodeEnd":512,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/sticker.rs#L476-L512","documentation":"convert_one shells out to ffmpeg (a quality-ladder conversion for WhatsApp stickers) and, when the process exits non-zero on the FIRST ladder step, returns the trimmed ffmpeg stderr verbatim via anyhow!(\"{}\", msg). It propagates the raw ffmpeg diagnostic because at step one there is no prior good output to fall back to.","triggerScenarios":"Calling convert_one (via the sticker tool's run) when the first ffmpeg quality attempt fails: ffmpeg binary missing/incompatible, unsupported or corrupt input file, or bad codec args — anything that makes ffmpeg print to stderr and exit non-zero while `best` is still None.","commonSituations":"ffmpeg not installed or not on PATH; input media corrupted or a format ffmpeg can't decode (e.g. HEVC without libhevc support in the build); a broken/custom ffmpeg build rejecting the flag set; disk-full or unreadable input path.","solutions":["Run the same ffmpeg command manually to see the full stderr and fix the underlying cause","Ensure ffmpeg is installed and the build supports the needed codecs (ffmpeg -codecs)","Verify the input file is valid media (ffprobe it)","Check disk space and permissions on the output directory"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"let ok = std::process::Command::new(\"ffmpeg\").arg(\"-version\").output().map(|o| o.status.success()).unwrap_or(false);\nif !ok { return Err(\"ffmpeg unavailable; cannot convert sticker\"); }\nlet probe = std::process::Command::new(\"ffprobe\").arg(&input).output()?;\nif !probe.status.success() { return Err(\"input media is not decodable\"); }","typeGuard":null,"tryCatchPattern":"match convert_one(&input, &output, &spec).await {\n    Err(e) => { tracing::error!(\"sticker convert failed: {e}\"); /* surface ffmpeg stderr to user */ }\n    Ok(item) => { /* use item */ }\n}","preventionTips":["Install a full-featured ffmpeg build with common codecs","ffprobe input files before conversion","Check available disk space in the output dir","Pin the ffmpeg version used in CI/production"],"tags":["ffmpeg","media-processing","process-failure","rust","anyhow"],"backgroundTag":"command-not-found","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"}