Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix: use h264_mf format for windows, its available in avbuild ffmpeg

tribhuwan-kumare8f21b4c6e8b
diff --git a/screenpipe-server/src/video.rs b/screenpipe-server/src/video.rs
index c0833f834..0e040ca0c 100644
--- a/screenpipe-server/src/video.rs
+++ b/screenpipe-server/src/video.rs
@@ -355,8 +355,21 @@ async fn start_ffmpeg_process(output_file: &str, fps: f64) -> Result<Child, anyh
"pad=width=ceil(iw/2)*2:height=ceil(ih/2)*2",
];
- // Use libx264 for all platforms
- args.extend_from_slice(&["-vcodec", "libx264", "-preset", "ultrafast", "-crf", "23", ]);
+ if env::consts::OS == "windows" {
+ // TODO switch back to libx264 when ffmpeg is updated in pre_build.js
+ // Use H264_MF encoder for Windows
+ args.extend_from_slice(&[
+ "-vcodec",
+ "h264_mf",
+ "-q:v",
+ "5",
+ "-preset",
+ "ultrafast",
+ ]);
+ } else {
+ // Use libx264 for other platforms
+ args.extend_from_slice(&["-vcodec", "libx264", "-preset", "ultrafast", "-crf", "23"]);
+ }
args.extend_from_slice(&["-pix_fmt", "yuv420p", output_file]);