Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

perf(desktop-gpui): encode imports with x264 frame threads

Theophilus2003af43922299f5
diff --git a/apps/desktop-gpui/src/import.rs b/apps/desktop-gpui/src/import.rs
index a195f3063..27e091198 100644
--- a/apps/desktop-gpui/src/import.rs
+++ b/apps/desktop-gpui/src/import.rs
@@ -1409,6 +1409,10 @@ fn open_h264_with_codec(
"libx264" => {
options.set("preset", "veryfast");
options.set("tune", "zerolatency");
+ // zerolatency also switches x264 to sliced threads, which encode one
+ // frame at a time. An offline import can take frame threads' few
+ // frames of delay; the stream stays free of B-frames and lookahead.
+ options.set("x264-params", "sliced-threads=0");
options.set("g", &keyframe_interval);
options.set("keyint_min", &keyframe_interval);
}