{"record":{"id":"1c596b87a95be353","repo":"tonhowtf/omniget","slug":"ffmpeg","errorCode":null,"errorMessage":"ffmpeg: {}","messagePattern":"ffmpeg: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/dictation.rs","lineNumber":251,"sourceCode":"pub async fn start(progress: super::ProgressFn) -> anyhow::Result<()> {\n    {\n        let rec = REC.lock().unwrap_or_else(|e| e.into_inner());\n        if rec.is_some() {\n            return Err(anyhow!(\"ja esta gravando\"));\n        }\n    }\n    let ffmpeg = crate::core::dependencies::ensure_ffmpeg().await?;\n    let opts = options();\n    let wav = super::temp_dir().join(format!(\"dictation-{}.wav\", uuid::Uuid::new_v4()));\n    let mut cmd = crate::core::process::command(&ffmpeg);\n    cmd.args([\"-y\", \"-hide_banner\", \"-loglevel\", \"error\"]);\n    cmd.args(input_args(&opts.device));\n    cmd.args([\"-ac\", \"1\", \"-ar\", \"16000\", \"-c:a\", \"pcm_s16le\"])\n        .arg(&wav);\n    cmd.stdin(std::process::Stdio::piped())\n        .stdout(std::process::Stdio::null())\n        .stderr(std::process::Stdio::piped());\n    let child = cmd.spawn().map_err(|e| anyhow!(\"ffmpeg: {}\", e))?;\n    *REC.lock().unwrap_or_else(|e| e.into_inner()) = Some(Recording {\n        child,\n        wav,\n        started: Instant::now(),\n    });\n    set_phase(\"recording\");\n    *LAST.lock().unwrap_or_else(|e| e.into_inner()) = None;\n    super::report(&progress, \"dictation\", \"recording\", 0, None, None);\n    Ok(())\n}\n\n/// Para a gravação, transcreve e entrega o texto. Devolve o texto.\npub async fn stop(progress: super::ProgressFn) -> anyhow::Result<String> {\n    let rec = REC.lock().unwrap_or_else(|e| e.into_inner()).take();\n    let Some(mut rec) = rec else {\n        return Err(anyhow!(\"nao esta gravando\"));\n    };\n    set_phase(\"transcribing\");","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/dictation.rs#L233-L269","documentation":"start() wraps the ffmpeg child process spawn failure with the message 'ffmpeg: {}'. It fires when std::process::Command::spawn() cannot launch the resolved ffmpeg binary, and the underlying io::Error (e.g. NotFound, PermissionDenied) is interpolated into the message.","triggerScenarios":"cmd.spawn() returns Err — typically because the ffmpeg path is invalid, the binary lacks execute permission, or the system cannot fork/exec.","commonSituations":"ensure_ffmpeg() returned a stale or broken path; user deleted/moved the bundled or downloaded ffmpeg; antivirus or sandbox blocks execution; PATH changed since dependency check.","solutions":["Verify the ffmpeg path returned by dependencies::ensure_ffmpeg() exists and is executable; re-run the dependency install if not.","Re-install or re-download ffmpeg (e.g. re-run the app's dependency setup) and retry.","Check that no antivirus/permission policy is blocking execution of the ffmpeg binary.","Test the binary manually: run '<ffmpeg-path> -version' in a shell."],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"// check ffmpeg before calling start\nif !ffmpeg_path.exists() {\n    // trigger dependency install flow first\n}","typeGuard":null,"tryCatchPattern":"match dictation::start(progress).await {\n    Err(e) if e.to_string().starts_with(\"ffmpeg:\") => reinstall_ffmpeg().await?,\n    other => other?,\n}","preventionTips":["Re-run ensure_ffmpeg() at app startup, not only when recording.","Verify the ffmpeg binary with '<path> -version' after install/update.","Keep the binary inside an app-controlled, antivirus-friendly directory."],"tags":["ffmpeg","process-spawn","dictation","missing-dependency"],"backgroundTag":"missing-dependency","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"}