{"record":{"id":"76806809e6d5350c","repo":"tonhowtf/omniget","slug":"ffmpeg-nao-iniciou-video-gif","errorCode":null,"errorMessage":"ffmpeg nao iniciou: {}","messagePattern":"ffmpeg nao iniciou: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src-tauri/omniget-core/src/core/tools/video_gif.rs","lineNumber":147,"sourceCode":"        opts.suffix,\n        output_ext(&opts.format)\n    ));\n    let chain = vf_chain(opts.fps, opts.width);\n    let cut = cut_args(opts.start, opts.duration);\n\n    if output_ext(&opts.format) == \"webp\" {\n        let out = crate::core::process::command(ffmpeg)\n            .args([\"-y\", \"-hide_banner\", \"-loglevel\", \"error\"])\n            .args(&cut)\n            .arg(\"-i\")\n            .arg(inp)\n            .args([\"-vf\", &chain, \"-c:v\", \"libwebp_anim\", \"-lossless\", \"0\"])\n            .args([\"-q:v\", &opts.quality.clamp(1, 100).to_string()])\n            .args([\"-loop\", \"0\", \"-an\"])\n            .arg(&output)\n            .output()\n            .await\n            .map_err(|e| anyhow!(\"ffmpeg nao iniciou: {}\", e))?;\n        if !out.status.success() {\n            return Err(anyhow!(\"{}\", String::from_utf8_lossy(&out.stderr).trim()));\n        }\n    } else {\n        let tmp =\n            std::env::temp_dir().join(format!(\"omniget-palette-{}.png\", uuid::Uuid::new_v4()));\n        let pass1 = crate::core::process::command(ffmpeg)\n            .args([\"-y\", \"-hide_banner\", \"-loglevel\", \"error\"])\n            .args(&cut)\n            .arg(\"-i\")\n            .arg(inp)\n            .args([\n                \"-vf\",\n                &format!(\n                    \"{},palettegen=max_colors={}:stats_mode=diff\",\n                    chain,\n                    opts.max_colors.clamp(4, 256)\n                ),","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/video_gif.rs#L129-L165","documentation":"In convert_one's single-pass branch (direct libwebp_anim/GIF output), spawning ffmpeg failed: cmd.output() returned an io error wrapped as 'ffmpeg nao iniciou: {}'. The converter could not start the ffmpeg process at all.","triggerScenarios":"GIF/WebP conversion invoked when the ffmpeg binary path is wrong, the binary is missing or non-executable, or PATH resolution fails in the packaged app environment.","commonSituations":"ffmpeg not installed on the machine; app bundle missing the sidecar binary; wrong custom ffmpeg path in settings; execute permission stripped after copying the binary; Windows PATH not propagated to the spawned process.","solutions":["Confirm ffmpeg exists and runs at the configured path (`<ffmpeg> -version`); install or bundle it.","Use an absolute path to the ffmpeg binary instead of relying on PATH lookup.","Fix file permissions (chmod +x) and check that security software is not blocking process creation."],"exampleFix":"// before\nlet ffmpeg = \"ffmpeg\";\n// after\nlet ffmpeg = which::which(\"ffmpeg\").context(\"ffmpeg not found on PATH; install it or set ffmpeg_path\")?;","handlingStrategy":"validation","validationCode":"fn ensure_ffmpeg(path: &Path) -> anyhow::Result<()> {\n    anyhow::ensure!(path.is_file(), \"ffmpeg nao encontrado: {}\", path.display());\n    #[cfg(unix)]\n    anyhow::ensure!(std::fs::metadata(path)?.permissions().mode() & 0o111 != 0, \"ffmpeg sem permissão de execução\");\n    Ok(())\n}","typeGuard":"fn spawnable(p: &Path) -> bool { p.is_file() }","tryCatchPattern":"if let Err(e) = convert_one(...).await {\n    if e.to_string().contains(\"nao iniciou\") {\n        eprintln!(\"instale/bundle o ffmpeg: {e}\");\n    } else { return Err(e); }\n}","preventionTips":["Ship ffmpeg as a sidecar and resolve the absolute path at startup.","Health-check `ffmpeg -version` before offering conversion features.","Keep execute bits intact when copying binaries into app bundles."],"tags":["ffmpeg","process-spawn","io","rust"],"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"}