{"record":{"id":"f38610cc9a576a0e","repo":"tonhowtf/omniget","slug":"ffmpeg-nao-converteu-o-video","errorCode":null,"errorMessage":"ffmpeg nao converteu o video: {}","messagePattern":"ffmpeg nao converteu o video: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/pinterest/media.rs","lineNumber":257,"sourceCode":"            \"-headers\",\n            \"Referer: https://www.pinterest.com/\\r\\n\",\n            \"-protocol_whitelist\",\n            \"file,http,https,tcp,tls,crypto\",\n            \"-i\",\n            hls,\n            \"-c\",\n            \"copy\",\n            \"-bsf:a\",\n            \"aac_adtstoasc\",\n            \"-movflags\",\n            \"+faststart\",\n        ])\n        .arg(out)\n        .output()\n        .await?;\n    if !o.status.success() {\n        let err = String::from_utf8_lossy(&o.stderr);\n        return Err(anyhow!(\n            \"ffmpeg nao converteu o video: {}\",\n            err.lines().last().unwrap_or(\"\").trim()\n        ));\n    }\n    Ok(())\n}\n\n/// Baixa tudo de um pin para `dir`. Devolve os caminhos gravados.\npub async fn download_pin(\n    client: &PinClient,\n    pin: &Pin,\n    dir: &Path,\n    opts: &DownloadOptions,\n) -> anyhow::Result<Vec<String>> {\n    let base = base_name(pin, &opts.naming);\n    let mut files = Vec::new();\n\n    let save_image =","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/pinterest/media.rs#L239-L275","documentation":"download_video in the Pinterest tool shells out to ffmpeg to transcode/mux the downloaded media into the final video file. If the ffmpeg child process exits with a non-zero status, the error wraps the last line of ffmpeg's stderr, which is where ffmpeg prints its final fatal diagnostic. This means the media was downloaded but post-processing failed, so no usable output video exists.","triggerScenarios":"Calling download_pin (which calls download_video) when ffmpeg cannot decode the downloaded stream (corrupt/partial download, unsupported codec/container), when the output path is unwritable, or when incompatible/invalid ffmpeg args are used.","commonSituations":"ffmpeg not compiled with the needed codec (e.g. missing libx264 or AAC encoder), disk full, output file locked by another process, or the pinned video URL returned an HTML error page instead of media that ffmpeg then chokes on.","solutions":["Read the wrapped stderr tail in the message — it names the exact ffmpeg failure (codec, I/O, or argument error)","Re-run the download to rule out a truncated/corrupt intermediate download","Verify the installed ffmpeg supports the required codecs (ffmpeg -encoders | grep -E 'libx264|aac')","Check disk space and write permissions on the destination directory","Update ffmpeg to a full build (e.g. from a static build) if a codec is missing"],"exampleFix":"// before: assuming ffmpeg handles any input\n.output().await?;\n// after: probe the file / check tool first, and surface full stderr\nlet ffmpeg = crate::core::dependencies::find_tool(\"ffmpeg\").await\n    .ok_or_else(|| anyhow!(\"ffmpeg não encontrado\"))?;\nif !o.status.success() {\n    let err = String::from_utf8_lossy(&o.stderr);\n    return Err(anyhow!(\"ffmpeg nao converteu o video: {}\", err));\n}","handlingStrategy":"try-catch","validationCode":"if crate::core::dependencies::find_tool(\"ffmpeg\").await.is_none() {\n    return Err(anyhow!(\"ffmpeg não disponível\"));\n}","typeGuard":null,"tryCatchPattern":"match download_pin(&opts).await {\n    Err(e) if e.to_string().contains(\"ffmpeg nao converteu\") => {\n        eprintln!(\"falha na conversão: {e}. verifique codecs/disco e tente de novo\");\n    }\n    Err(e) => eprintln!(\"erro: {e}\"),\n    Ok(files) => println!(\"ok: {:?}\", files),\n}","preventionTips":["Install a full-featured ffmpeg build with common codecs (libx264, aac)","Check free disk space before large video downloads","Log the full ffmpeg stderr, not just the last line, when debugging"],"tags":["ffmpeg","external-process","video-conversion","rust"],"backgroundTag":"git-command-failed","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"}