tonhowtf/omniget · warning · anyhow::Error
FFmpeg is provided by the Flatpak runtime and cannot be…
Error message
FFmpeg is provided by the Flatpak runtime and cannot be updated from inside the app
What it means
update_ffmpeg refuses to run inside a Flatpak sandbox because FFmpeg there is supplied by the Flatpak runtime, not managed by the app. Updating it from inside the app is impossible (the runtime is read-only from the sandbox's perspective), so the call fails fast with this explanatory message.
Solutions
- Don't expose/call update_ffmpeg when running under Flatpak; hide the update button in that environment.
- Update FFmpeg by updating the Flatpak runtime: flatpak update (or the relevant runtime extension, e.g. org.freedesktop.Platform.ffmpeg-full).
- If a newer ffmpeg is truly needed, wait for a runtime/extension update upstream or use a non-Flatpak install.
Example fix
// before
update_ffmpeg().await?;
// after
if dependencies::is_flatpak() {
eprintln!("Update FFmpeg via the Flatpak runtime: flatpak update");
return Ok(());
}
update_ffmpeg().await?; Defensive patterns
Strategy: type-guard
Validate before calling
if dependencies::is_flatpak() {
eprintln!("FFmpeg updates come from the Flatpak runtime; run: flatpak update");
return Ok(());
} Type guard
fn can_update_ffmpeg_in_app() -> bool { !dependencies::is_flatpak() } Try / catch
match update_ffmpeg().await {
Ok(p) => p,
Err(e) if format!("{e}").contains("Flatpak runtime") => {
eprintln!("Update the Flatpak runtime instead: flatpak update");
return Ok(());
}
Err(e) => return Err(e),
} Prevention
- Check is_flatpak() before showing any in-app FFmpeg update UI.
- Show runtime-extension update instructions to Flatpak users.
- Add CI coverage for Flatpak build paths to catch sandbox-only code paths.
When it happens
Trigger: Calling update_ffmpeg (UI 'update ffmpeg' action) while the app runs as a Flatpak (is_flatpak() detects the sandbox, e.g. via /.flatpak-info).
Common situations: User installed the app from Flathub and clicks 'Update FFmpeg'; expecting bundled-runtime ffmpeg to be upgradable in-app.
Understand the failure class
Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.
Related errors
- yt-dlp not found in Flatpak sandbox
- yt-dlp is provided by the Flatpak runtime and cannot be…
- FFmpeg not found in Flatpak sandbox
- dentro do Flatpak o Spicetify nao consegue alterar o…
- xclip not found
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/ca1853a0eb70322a.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/core/dependencies.rs:366
));
}
if let Err(e) = std::fs::rename(temp, target) {
let _ = std::fs::rename(&old, target);
let _ = std::fs::remove_file(temp);
return Err(anyhow!("Failed to replace {}: {}", file_name, e));
}
let _ = std::fs::remove_file(&old);
Ok(())
} else {
std::fs::rename(temp, target)
.map_err(|e| anyhow!("Failed to replace {}: {}", target.display(), e))?;
Ok(())
}
}
pub async fn update_ffmpeg() -> anyhow::Result<PathBuf> {
if is_flatpak() {
return Err(anyhow!(
"FFmpeg is provided by the Flatpak runtime and cannot be updated from inside the app"
));
}
let path = download_ffmpeg().await?;
crate::core::ytdlp::reset_ffmpeg_location_cache();
Ok(path)
}
pub async fn ensure_ffmpeg() -> anyhow::Result<PathBuf> {
// Always ensure the managed binary exists — the standalone yt-dlp.exe
// cannot discover system FFmpeg from PATH.
if !is_flatpak() {
let managed = managed_bin_dir().map(|d| d.join(bin_name("ffmpeg")));
if managed.as_ref().map_or(true, |p| !p.exists()) {
if let Ok(path) = download_ffmpeg().await {
crate::core::ytdlp::reset_ffmpeg_location_cache();
return Ok(path);
}View on GitHub (pinned to 8600b91f42)