tonhowtf/omniget · error
ffmpeg encerrou na largada (permissao de Gravacao de Tela?)
Error message
ffmpeg encerrou na largada (permissao de Gravacao de Tela?)
What it means
After spawning ffmpeg, start() reads early stderr; if ffmpeg exits immediately at startup, it raises this message (or the actual stderr text if non-empty). The parenthetical hint points at the most common cause: missing macOS Screen Recording permission.
Solutions
- On macOS: grant Screen Recording permission to the app in System Settings > Privacy & Security > Screen Recording, then restart the app
- Inspect the ERROR global / captured stderr for the precise ffmpeg message when it is not empty
- Verify capture arguments match the platform and input device (display number, framerate, audio device)
- Run the exact ffmpeg command line manually to reproduce and debug the failure
Example fix
// before
let state = start(opts).await?; // fails: ffmpeg exited immediately
// after
match start(opts).await {
Ok(s) => Ok(s),
Err(e) if e.to_string().contains("encerrou na largada") => {
eprintln!("check Screen Recording permission / capture args: {}", get_error().await?);
Err(e)
}
Err(e) => Err(e),
} Defensive patterns
Strategy: try-catch
Validate before calling
// macOS: check TCC screen-recording permission before starting
#[cfg(target_os = "macos")]
if !screen_capture_permission_granted() {
eprintln!("grant Screen Recording permission in System Settings, then restart the app");
} Try / catch
match screen_record::start(opts).await {
Err(e) if e.to_string().contains("encerrou na largada") => {
eprintln!("ffmpeg died at startup — check Screen Recording permission and capture args");
// surface the stored detailed error
if let Some(detail) = *screen_record::ERROR.lock().unwrap() { eprintln!("detail: {}", detail); }
Err(e)
}
other => other,
} Prevention
- On macOS, grant Screen Recording permission to the host app before first use and restart it
- Test the exact ffmpeg command manually to validate capture arguments
- Confirm DISPLAY/xauth validity in headless or SSH sessions
When it happens
Trigger: ffmpeg exits with non-zero status right after spawn — invalid capture args for the platform, missing Screen Recording permission on macOS, device/permission errors on Linux (no /dev/video, x11grab auth failure), or an unsupported pixel format.
Common situations: macOS TCC permission not granted to the host app in System Settings > Privacy > Screen Recording; wrong DISPLAY/xauth in headless or SSH sessions; invalid output codec/arguments rejected instantly by ffmpeg.
Understand the failure class
Background: Permission denied / not authorized / 403 Forbidden: access-control rejections when the caller lacks the required role, grant, or ownership — this error's family across 18 libraries.
Related errors
- FFmpeg installed but failed to execute
- sessao Wayland sem XWayland: o x11grab nao enxerga a tela…
- ffmpeg
- {}
- spawn_blocking failed
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/a39898029fa5d596.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/omniget-core/src/core/tools/screen_record.rs:398
_ => None,
},
None => None,
}
};
if let Some(stderr) = died {
let mut msg = String::new();
if let Some(mut e) = stderr {
use tokio::io::AsyncReadExt;
let _ = e.read_to_string(&mut msg).await;
}
*SESSION.lock().unwrap_or_else(|e| e.into_inner()) = None;
let msg = if msg.trim().is_empty() {
"ffmpeg encerrou na largada (permissao de Gravacao de Tela?)".to_string()
} else {
msg.trim().to_string()
};
*ERROR.lock().unwrap_or_else(|e| e.into_inner()) = Some(msg.clone());
return Err(anyhow!(msg));
}
Ok(state())
}
async fn stop_child(mut child: tokio::process::Child) {
if let Some(mut stdin) = child.stdin.take() {
use tokio::io::AsyncWriteExt;
let _ = stdin.write_all(b"q\n").await;
let _ = stdin.flush().await;
}
if tokio::time::timeout(std::time::Duration::from_secs(10), child.wait())
.await
.is_err()
{
let _ = child.kill().await;
}
}
View on GitHub (pinned to 8600b91f42)