Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

only wallclock audio sometimes

Brendan Alland4a2d9b1d869
diff --git a/apps/desktop-solid/src-tauri/src/lib.rs b/apps/desktop-solid/src-tauri/src/lib.rs
index bf1f8bd14..85823ebd6 100644
--- a/apps/desktop-solid/src-tauri/src/lib.rs
+++ b/apps/desktop-solid/src-tauri/src/lib.rs
@@ -319,6 +319,7 @@ async fn render_to_file_impl(
sample_format: "f64le".to_string(),
sample_rate: 44100,
channels: 1,
+ wallclock: false,
});
Some((file_path, file, dir))
diff --git a/apps/desktop-solid/src-tauri/src/recording.rs b/apps/desktop-solid/src-tauri/src/recording.rs
index 15f43dbdc..2b358a319 100644
--- a/apps/desktop-solid/src-tauri/src/recording.rs
+++ b/apps/desktop-solid/src-tauri/src/recording.rs
@@ -181,7 +181,7 @@ pub async fn start(
sample_format: capturer.sample_format().to_string(),
sample_rate: capturer.sample_rate(),
channels: capturer.channels(),
- // offset: start_time.duration_since(latest_start_time).as_secs_f64(),
+ wallclock: true, // offset: start_time.duration_since(latest_start_time).as_secs_f64(),
});
ffmpeg
diff --git a/crates/ffmpeg/src/lib.rs b/crates/ffmpeg/src/lib.rs
index 1ddecf6e1..e716ee8c3 100644
--- a/crates/ffmpeg/src/lib.rs
+++ b/crates/ffmpeg/src/lib.rs
@@ -218,7 +218,7 @@ pub struct FFmpegRawAudioInput {
pub sample_rate: u32,
pub channels: u16,
pub input: OsString,
- // pub offset: f64,
+ pub wallclock: bool, // pub offset: f64,
}
impl ApplyFFmpegArgs for FFmpegRawAudioInput {
@@ -227,14 +227,17 @@ impl ApplyFFmpegArgs for FFmpegRawAudioInput {
command
.args(["-f", &self.sample_format])
.args(["-ar", &self.sample_rate.to_string()])
- .args(["-ac", &self.channels.to_string()])
- .args(["-use_wallclock_as_timestamps", "1"])
- .args(["-thread_queue_size", "4096", "-i"]);
+ .args(["-ac", &self.channels.to_string()]);
+
+ if self.wallclock {
+ command.args(["-use_wallclock_as_timestamps", "1"]);
+ }
// if self.offset != 0.0 {
// command.args(["-itsoffset", &self.offset.to_string()]);
// }
+ command.args(["-thread_queue_size", "4096", "-i"]);
command.arg(&self.input);
}
}