diff --git a/src-tauri/src/capture.rs b/src-tauri/src/capture.rs index 5613cb3..ccca6a9 100644 --- a/src-tauri/src/capture.rs +++ b/src-tauri/src/capture.rs @@ -73,6 +73,11 @@ impl GraphicsCaptureApiHandler for CaptureHandler { // correct. The fps filter in the export pipeline handles the conversion. tracing::info!("capture: size={}x{}", setup.width, setup.height); + // Declare a high-ish framerate so ffmpeg accepts all frames from the pipe. + // The actual delivery rate varies; fix_intermediate_fps re-encodes with + // the measured rate after capture. + let capture_fps = 120u32; + let mut cmd = Command::new(&setup.ffmpeg_path); cmd.arg("-y") .arg("-hide_banner") @@ -80,6 +85,7 @@ impl GraphicsCaptureApiHandler for CaptureHandler { .args(["-f", "rawvideo"]) .args(["-pixel_format", "bgra"]) .args(["-video_size", &format!("{}x{}", setup.width, setup.height)]) + .args(["-framerate", &capture_fps.to_string()]) .args(["-i", "-"]) .args(["-vf", &filter]) .args(["-c:v", "libx264"])