Skip to content

Commit 75206ff

Browse files
Merge pull request #1675 from CapSoftware/cursor/cap-export-speed-ad7f
perf: improve export speed with pipeline restructure, cursor precomputation, and encoder tuning
2 parents 8be2327 + 036968b commit 75206ff

File tree

7 files changed

+801
-303
lines changed

7 files changed

+801
-303
lines changed

apps/desktop/src-tauri/src/editor_window.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async fn do_prewarm(app: AppHandle, path: PathBuf) -> PendingResult {
3737
GpuOutputFormat::Rgba => WSFrameFormat::Rgba,
3838
};
3939
WSFrame {
40-
data: frame.data,
40+
data: Arc::new(frame.data.into_vec()),
4141
width: frame.width,
4242
height: frame.height,
4343
stride: frame.y_stride,
@@ -254,7 +254,7 @@ impl EditorInstances {
254254
GpuOutputFormat::Rgba => WSFrameFormat::Rgba,
255255
};
256256
WSFrame {
257-
data: frame.data,
257+
data: Arc::new(frame.data.into_vec()),
258258
width: frame.width,
259259
height: frame.height,
260260
stride: frame.y_stride,

crates/enc-ffmpeg/src/video/h264.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,18 @@ fn get_codec_and_options(
776776
_ => "veryfast",
777777
},
778778
);
779+
if !matches!(preset, H264Preset::Slow | H264Preset::Medium) {
780+
let thread_count = thread::available_parallelism()
781+
.map(|v| v.get())
782+
.unwrap_or(4);
783+
options.set("threads", &thread_count.to_string());
784+
options.set("rc-lookahead", "10");
785+
options.set("b-adapt", "1");
786+
options.set("aq-mode", "1");
787+
options.set("ref", "2");
788+
options.set("subme", "2");
789+
options.set("trellis", "0");
790+
}
779791
} else {
780792
options.set(
781793
"preset",

0 commit comments

Comments
 (0)