{"record":{"id":"85df47ecfb542dbd","repo":"tonhowtf/omniget","slug":"ffmpeg-not-found-in-flatpak-sandbox","errorCode":null,"errorMessage":"FFmpeg not found in Flatpak sandbox","messagePattern":"FFmpeg not found in Flatpak sandbox","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"critical","filePath":"src-tauri/omniget-core/src/core/dependencies.rs","lineNumber":392,"sourceCode":"\npub async fn ensure_ffmpeg() -> anyhow::Result<PathBuf> {\n    // Always ensure the managed binary exists — the standalone yt-dlp.exe\n    // cannot discover system FFmpeg from PATH.\n    if !is_flatpak() {\n        let managed = managed_bin_dir().map(|d| d.join(bin_name(\"ffmpeg\")));\n        if managed.as_ref().map_or(true, |p| !p.exists()) {\n            if let Ok(path) = download_ffmpeg().await {\n                crate::core::ytdlp::reset_ffmpeg_location_cache();\n                return Ok(path);\n            }\n        }\n    }\n\n    if let Some(path) = find_tool(\"ffmpeg\").await {\n        return Ok(path);\n    }\n    if is_flatpak() {\n        return Err(anyhow!(\"FFmpeg not found in Flatpak sandbox\"));\n    }\n    let path = download_ffmpeg().await?;\n    crate::core::ytdlp::reset_ffmpeg_location_cache();\n    Ok(path)\n}\n\nasync fn download_ffmpeg() -> anyhow::Result<PathBuf> {\n    let bin_dir = managed_bin_dir().ok_or_else(|| anyhow!(\"Could not determine data directory\"))?;\n    std::fs::create_dir_all(&bin_dir)?;\n\n    let ffmpeg_name = bin_name(\"ffmpeg\");\n    let ffprobe_name = bin_name(\"ffprobe\");\n    let ffmpeg_target = bin_dir.join(&ffmpeg_name);\n\n    let downloads = ffmpeg_download_urls();\n\n    let client = crate::core::http_client::apply_global_proxy(reqwest::Client::builder())\n        .timeout(std::time::Duration::from_secs(300))","sourceCodeStart":374,"sourceCodeEnd":410,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/dependencies.rs#L374-L410","documentation":"ensure_ffmpeg first tries find_tool(\"ffmpeg\") and, inside a Flatpak sandbox, cannot fall back to downloading a private copy — so if no ffmpeg is discoverable in the sandbox it fails with this error. It signals that the Flatpak runtime's ffmpeg (or its ffmpeg-full extension) is missing.","triggerScenarios":"ensure_ffmpeg() called in a Flatpak environment where find_tool(\"ffmpeg\") returns None: the freedesktop runtime's org.freedesktop.Platform.ffmpeg-full extension is not installed, or PATH/lookup locations don't include any ffmpeg.","commonSituations":"Flatpak installed with a base runtime lacking the ffmpeg-full extension; minimal runtime variant; user stripped extensions to save space.","solutions":["Install the Flatpak ffmpeg extension: flatpak install flathub org.freedesktop.Platform.ffmpeg-full//<version> (match your runtime version).","Run flatpak update so the runtime and extensions are current, then restart the app.","Check the installed runtime: flatpak info <app> and confirm the matching ffmpeg-full branch is present.","As a last resort, ship/bundle ffmpeg with the app or switch to a build that includes it."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// Before calling ensure_ffmpeg, probe availability\nif dependencies::find_tool(\"ffmpeg\").await.is_none() && dependencies::is_flatpak() {\n    eprintln!(\"Install the runtime ffmpeg extension: flatpak install flathub org.freedesktop.Platform.ffmpeg-full\");\n}","typeGuard":null,"tryCatchPattern":"match ensure_ffmpeg().await {\n    Ok(p) => p,\n    Err(e) if format!(\"{e}\").contains(\"Flatpak sandbox\") => {\n        eprintln!(\"ffmpeg missing; install org.freedesktop.Platform.ffmpeg-full and restart\");\n        return Err(e);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Declare/depend on org.freedesktop.Platform.ffmpeg-full in the Flatpak manifest so it installs with the app.","Probe ffmpeg availability at app startup and guide the user to the extension install command.","Keep find_tool()'s search paths in sync with Flatpak runtime locations."],"tags":["flatpak","linux","missing-dependency","ffmpeg"],"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"}