Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ default = ["custom-protocol"]
custom-protocol = ["tauri/custom-protocol"]

[lints.rust]
# The `objc` crate's msg_send! macro expands to a `cfg(cargo-clippy)` check;
# declare it as a known cfg so it doesn't trip the unexpected_cfgs lint.
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(cargo-clippy)'] }
# The `objc` crate's msg_send! macro references a `cargo-clippy` cfg that trips
# the unexpected_cfgs lint — it's from the dependency macro, not our code.
unexpected_cfgs = "allow"
10 changes: 9 additions & 1 deletion src-tauri/src/audio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,21 @@ impl AudioRecorder {
output_path.display()
);

// The captured audio is AAC, but the container dictates the codec:
// WebM (VP9) can't hold AAC — it needs Opus; MP4 takes AAC. Using the
// wrong codec makes the mux fail, leaving a silent video-only file.
let audio_codec = match format {
"mp4" => "aac",
_ => "libopus", // webm
};

let status = Command::new(ffmpeg_path())
.args([
"-y",
"-i", &video_path.to_string_lossy(),
"-i", &audio_path.to_string_lossy(),
"-c:v", "copy",
"-c:a", "aac",
"-c:a", audio_codec,
"-shortest",
&output_path.to_string_lossy(),
])
Expand Down
4 changes: 4 additions & 0 deletions src/services/capture/tauri.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ export class TauriCaptureService implements CaptureService {
fps: options?.fps,
displayId: options?.displayId,
bounds: options?.bounds,
// Without these the Rust side never starts the audio recorder,
// so recordings came out silent.
includeAudio: options?.includeAudio,
systemAudio: options?.systemAudio,
},
});

Expand Down
Loading