YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
feat(cli): add --disable-snapshot-compaction to skip JPEG→MP4 worker
nakagawa28b004d488cd
diff --git a/crates/screenpipe-config/src/recording.rs b/crates/screenpipe-config/src/recording.rsindex 33004acf1..9046253dd 100644--- a/crates/screenpipe-config/src/recording.rs+++ b/crates/screenpipe-config/src/recording.rs@@ -137,6 +137,13 @@ pub struct RecordingSettings {#[serde(rename = "maxSnapshotWidth", default = "default_max_snapshot_width")]pub max_snapshot_width: u32,+ /// Skip the background JPEG→MP4 snapshot compaction worker.+ /// Use when the MP4 timeline UI is not used (e.g. task-mining tools that consume+ /// `accessibility_text` / `ui_events` only) — avoids the ffmpeg H.265 encoding load.+ /// Side effect: JPEGs are not compacted, so disk usage depends on `--retention-days`.+ #[serde(rename = "disableSnapshotCompaction", default)]+ pub disable_snapshot_compaction: bool,+// ── Filters ────────────────────────────────────────────────────────/// Window titles to exclude from capture.#[serde(rename = "ignoredWindows")]@@ -369,6 +376,7 @@ impl Default for RecordingSettings {use_all_monitors: true,video_quality: "balanced".to_string(),max_snapshot_width: default_max_snapshot_width(),+ disable_snapshot_compaction: false,ignored_windows: vec![],included_windows: vec![],ignored_urls: vec![],diff --git a/crates/screenpipe-engine/src/bin/screenpipe-engine.rs b/crates/screenpipe-engine/src/bin/screenpipe-engine.rsindex 14eb1fc2f..91a89983a 100644--- a/crates/screenpipe-engine/src/bin/screenpipe-engine.rs+++ b/crates/screenpipe-engine/src/bin/screenpipe-engine.rs@@ -869,14 +869,20 @@ async fn main() -> anyhow::Result<()> {// Start power manager — polls battery/thermal state and broadcasts profile changeslet power_manager = start_power_manager();- // Start background snapshot compaction (JPEG → MP4)- screenpipe_engine::start_snapshot_compaction(- db.clone(),- config.video_quality.clone(),- shutdown_tx.subscribe(),- power_manager.clone(),- Some(hot_frame_cache.clone()),- );+ // Start background snapshot compaction (JPEG → MP4) unless explicitly disabled.+ // Skipping the worker avoids the ffmpeg H.265 encoding load for users who don't+ // need the MP4 timeline UI (task-mining tools, headless analysis pipelines, etc.).+ if !config.disable_snapshot_compaction {+ screenpipe_engine::start_snapshot_compaction(+ db.clone(),+ config.video_quality.clone(),+ shutdown_tx.subscribe(),+ power_manager.clone(),+ Some(hot_frame_cache.clone()),+ );+ } else {+ info!("snapshot compaction disabled via --disable-snapshot-compaction");+ }// Create VisionManager for event-driven capture on all monitorslet (handle, capture_trigger_tx) = if !config.disable_vision {diff --git a/crates/screenpipe-engine/src/cli/mod.rs b/crates/screenpipe-engine/src/cli/mod.rsindex 06b4839f5..7822f608e 100644--- a/crates/screenpipe-engine/src/cli/mod.rs+++ b/crates/screenpipe-engine/src/cli/mod.rs@@ -458,6 +458,13 @@ pub struct RecordArgs {/// everything (legacy behavior).#[arg(long, value_enum, default_value_t = crate::retention::RetentionMode::Media)]pub retention_mode: crate::retention::RetentionMode,++ /// Skip the background JPEG→MP4 snapshot compaction worker.+ /// Use when the MP4 timeline UI is not used (e.g. task-mining tools that consume+ /// `accessibility_text` / `ui_events` only) — avoids the ffmpeg H.265 encoding load.+ /// Side effect: JPEGs stay uncompacted, so disk usage depends on `--retention-days`.+ #[arg(long, default_value_t = false)]+ pub disable_snapshot_compaction: bool,}impl RecordArgs {@@ -527,6 +534,7 @@ impl RecordArgs {.collect(),deepgram_api_key: self.deepgram_api_key.clone().unwrap_or_default(),video_quality: self.video_quality.clone(),+ disable_snapshot_compaction: self.disable_snapshot_compaction,analytics_enabled: !self.disable_telemetry,ignore_incognito_windows: true,pause_on_drm_content: self.pause_on_drm_content,diff --git a/crates/screenpipe-engine/src/recording_config.rs b/crates/screenpipe-engine/src/recording_config.rsindex 6cea6b323..1c32e3630 100644--- a/crates/screenpipe-engine/src/recording_config.rs+++ b/crates/screenpipe-engine/src/recording_config.rs@@ -131,6 +131,10 @@ pub struct RecordingConfig {/// Maximum width for stored snapshots (0 = no limit). Default: 1920.pub max_snapshot_width: u32,+ /// Skip the background JPEG→MP4 snapshot compaction worker.+ /// See `RecordingSettings.disable_snapshot_compaction` for details.+ pub disable_snapshot_compaction: bool,+/// Require authentication for remote (non-localhost) API access./// When true, requests from other devices must include/// `Authorization: Bearer <SCREENPIPE_API_KEY>`.@@ -243,6 +247,7 @@ impl RecordingConfig {schedule_enabled: settings.schedule_enabled,schedule_rules: settings.schedule_rules.clone(),max_snapshot_width: settings.max_snapshot_width,+ disable_snapshot_compaction: settings.disable_snapshot_compaction,// LAN exposure is opt-in. We force `api_auth` on whenever// `listen_on_lan` is true so a user can never accidentally// publish an unauthenticated API on their local network. The