Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

perf(cli): skip the unused camera in macOS Instant recordings

Richie McIlroy5ce12c751074
diff --git a/apps/cli/src/record.rs b/apps/cli/src/record.rs
index 6416a8d31..58ff1eba1 100644
--- a/apps/cli/src/record.rs
+++ b/apps/cli/src/record.rs
@@ -754,15 +754,26 @@ async fn start_recording(
#[cfg(target_os = "macos")]
let target_for_shareable_content = target.clone();
+ let camera_only_target = matches!(target, ScreenCaptureTarget::CameraOnly);
let mut studio_builder = studio_recording::Actor::builder(path.clone(), target.clone())
.with_system_audio(params.system_audio);
let mut instant_builder =
instant_recording::Actor::builder(path, target).with_system_audio(params.system_audio);
let mut camera_active = false;
+ let camera_recorded =
+ !(cfg!(target_os = "macos") && params.mode == RecordMode::Instant && !camera_only_target);
// Feeds must be locked and attached before build(); the lock keeps the device open for the whole
// recording, so the feed actor handle itself does not need to be retained.
- if let Some(device_id) = params.camera.as_deref() {
+ // macOS Instant recordings capture only the screen (the desktop app's camera bubble is part of
+ // the screen), so a camera opened here would run for the whole recording without being recorded.
+ if params.camera.is_some() && !camera_recorded {
+ eprintln!(
+ "warning: --camera is ignored for Instant recordings on macOS; the camera is only recorded in Studio mode"
+ );
+ }
+
+ if let Some(device_id) = params.camera.as_deref().filter(|_| camera_recorded) {
let info = cap_camera::list_cameras()
.find(|c| c.device_id() == device_id)
.ok_or_else(|| {