restore -framerate 120 for capture, fix_intermediate_fps corrects after

This commit is contained in:
2026-05-30 01:51:04 +03:00
parent 4d521522fc
commit 076ac21980
+6
View File
@@ -73,6 +73,11 @@ impl GraphicsCaptureApiHandler for CaptureHandler {
// correct. The fps filter in the export pipeline handles the conversion. // correct. The fps filter in the export pipeline handles the conversion.
tracing::info!("capture: size={}x{}", setup.width, setup.height); 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); let mut cmd = Command::new(&setup.ffmpeg_path);
cmd.arg("-y") cmd.arg("-y")
.arg("-hide_banner") .arg("-hide_banner")
@@ -80,6 +85,7 @@ impl GraphicsCaptureApiHandler for CaptureHandler {
.args(["-f", "rawvideo"]) .args(["-f", "rawvideo"])
.args(["-pixel_format", "bgra"]) .args(["-pixel_format", "bgra"])
.args(["-video_size", &format!("{}x{}", setup.width, setup.height)]) .args(["-video_size", &format!("{}x{}", setup.width, setup.height)])
.args(["-framerate", &capture_fps.to_string()])
.args(["-i", "-"]) .args(["-i", "-"])
.args(["-vf", &filter]) .args(["-vf", &filter])
.args(["-c:v", "libx264"]) .args(["-c:v", "libx264"])