Skip to content

Commit a134903

Browse files
committed
fix: resolve camera preview and export pipeline issues
1 parent 75206ff commit a134903

4 files changed

Lines changed: 355 additions & 77 deletions

File tree

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,17 @@ async fn set_camera_input(
637637
let camera_in_use = app.camera_in_use;
638638
drop(app);
639639

640+
let skip_camera_window = skip_camera_window.unwrap_or(false);
641+
640642
if id == current_id && camera_in_use {
643+
if !skip_camera_window && CapWindowId::Camera.get(&app_handle).is_none() {
644+
let show_result = ShowCapWindow::Camera { centered: false }
645+
.show(&app_handle)
646+
.await;
647+
show_result
648+
.map_err(|err| error!("Failed to show camera preview window: {err}"))
649+
.ok();
650+
}
641651
return Ok(());
642652
}
643653

@@ -717,7 +727,7 @@ async fn set_camera_input(
717727
return Err(e);
718728
}
719729

720-
if !skip_camera_window.unwrap_or(false) {
730+
if !skip_camera_window {
721731
let show_result = ShowCapWindow::Camera { centered: false }
722732
.show(&app_handle)
723733
.await;

crates/enc-ffmpeg/src/base.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ impl EncoderBase {
8585
}
8686
}
8787

88+
if let (Some(pts), Some(dts)) = (self.packet.pts(), self.packet.dts())
89+
&& pts < dts
90+
{
91+
self.packet.set_pts(Some(dts));
92+
}
93+
8894
self.last_written_dts = self.packet.dts();
8995
self.packet.write_interleaved(output)?;
9096
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,8 +781,9 @@ fn get_codec_and_options(
781781
.map(|v| v.get())
782782
.unwrap_or(4);
783783
options.set("threads", &thread_count.to_string());
784+
options.set("bf", "0");
784785
options.set("rc-lookahead", "10");
785-
options.set("b-adapt", "1");
786+
options.set("b-adapt", "0");
786787
options.set("aq-mode", "1");
787788
options.set("ref", "2");
788789
options.set("subme", "2");

0 commit comments

Comments
 (0)