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(recording): single quality knob — fix unreadable text on ultrawides
Louis Beaumont8dce4406b6f9
diff --git a/apps/screenpipe-app-tauri/components/settings/recording-settings.tsx b/apps/screenpipe-app-tauri/components/settings/recording-settings.tsxindex 0067b5831..619cf095c 100644--- a/apps/screenpipe-app-tauri/components/settings/recording-settings.tsx+++ b/apps/screenpipe-app-tauri/components/settings/recording-settings.tsx@@ -1845,6 +1845,39 @@ Your screen is a pipe. Everything you see, hear, and type flows through it. Scre</Card>)}+ {/* Recording quality — single knob for crispness + disk cost */}+ {!settings.disableVision && (+ <Card className="border-border bg-card">+ <CardContent className="px-3 py-2.5">+ <div className="flex items-center justify-between gap-3">+ <div className="flex items-center space-x-2.5 min-w-0">+ <Monitor className="h-4 w-4 text-muted-foreground shrink-0" />+ <div className="min-w-0">+ <h3 className="text-sm font-medium text-foreground">Recording quality</h3>+ <p className="text-xs text-muted-foreground">+ Pick "high" or "max" if your text looks blurry on a 4K / ultrawide. Higher = crisper + larger files.+ </p>+ </div>+ </div>+ <Select+ value={settings.videoQuality || "balanced"}+ onValueChange={(value) => handleSettingsChange({ videoQuality: value }, true)}+ >+ <SelectTrigger className="w-[180px] h-8 text-xs">+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ <SelectItem value="low">low — 1280px, smallest</SelectItem>+ <SelectItem value="balanced">balanced — 1920px (default)</SelectItem>+ <SelectItem value="high">high — 3840px, ultrawide-safe</SelectItem>+ <SelectItem value="max">max — native, no downscale</SelectItem>+ </SelectContent>+ </Select>+ </div>+ </CardContent>+ </Card>+ )}+{/* Monitor Selection */}{!settings.disableVision && !settings.useAllMonitors && (<Card className="border-border bg-card overflow-hidden">diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lockindex 2ab1fcc4a..95c6aac6a 100644--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock@@ -9726,7 +9726,7 @@ dependencies = [[[package]]name = "screenpipe-app"-version = "2.4.100"+version = "2.4.101"dependencies = ["anyhow","arboard",diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml b/apps/screenpipe-app-tauri/src-tauri/Cargo.tomlindex 532ee91c6..ae7d7b8ea 100644--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml@@ -1,6 +1,6 @@[package]name = "screenpipe-app"-version = "2.4.100"+version = "2.4.101"description = "24/7 memory for your desktop. 100% local."authors = ["you"]license = ""diff --git a/crates/screenpipe-core/src/video.rs b/crates/screenpipe-core/src/video.rsindex 7762a1f13..475657483 100644--- a/crates/screenpipe-core/src/video.rs+++ b/crates/screenpipe-core/src/video.rs@@ -54,6 +54,38 @@ pub fn video_quality_to_jpeg_q(quality: &str) -> &'static str {}}+/// Max width (in px) for stored snapshot JPEGs at the given quality preset.+/// 0 = no downscale (store at native resolution).+///+/// The previous fixed 1920px cap silently crushed text on ultrawides+/// (49" 5120×1440 → 37% scale) — the cap now scales with the user's+/// quality setting so they have a single knob that decides legibility+/// AND disk cost together.+pub fn video_quality_to_max_snapshot_width(quality: &str) -> u32 {+ match quality {+ "low" => 1280,+ "high" => 3840,+ "max" => 0, // native, no downscale+ _ => 1920, // "balanced" or any unknown+ }+}++/// JPEG encoder quality (1–100) for the on-disk snapshot at the given+/// quality preset. Pairs with `video_quality_to_max_snapshot_width` so a+/// single user-facing setting controls both axes of "how large + how+/// crisp is each frame on disk".+///+/// Power profiles can still drop this further on battery/thermal — these+/// are the *intent* baselines, not absolute floors.+pub fn video_quality_to_jpeg_quality(quality: &str) -> u8 {+ match quality {+ "low" => 60,+ "high" => 85,+ "max" => 92,+ _ => 80, // "balanced" or any unknown+ }+}+pub async fn start_ffmpeg_process(output_file: &str,fps: f64,diff --git a/crates/screenpipe-engine/src/event_driven_capture.rs b/crates/screenpipe-engine/src/event_driven_capture.rsindex 04dcd755c..b240724ec 100644--- a/crates/screenpipe-engine/src/event_driven_capture.rs+++ b/crates/screenpipe-engine/src/event_driven_capture.rs@@ -509,8 +509,13 @@ pub async fn event_driven_capture_loop();state.config.min_capture_interval_ms = profile.min_capture_interval_ms;state.config.idle_capture_interval_ms = profile.idle_capture_interval_ms;- state.config.jpeg_quality = profile.jpeg_quality;- snapshot_writer.set_quality(profile.jpeg_quality);+ // Power profile can only LOWER quality from the user's baseline,+ // never raise it — picking "max" in settings shouldn't be silently+ // bumped above the profile's value, but a user on saver mode also+ // shouldn't see "max" honored when battery is critical.+ let effective_q = profile.jpeg_quality.min(state.config.jpeg_quality);+ state.config.jpeg_quality = effective_q;+ snapshot_writer.set_quality(effective_q);visual_check_interval = Duration::from_millis(profile.visual_check_interval_ms);visual_change_threshold = profile.visual_change_threshold;visual_check_enabled = profile.visual_check_interval_ms > 0;diff --git a/crates/screenpipe-engine/src/recording_config.rs b/crates/screenpipe-engine/src/recording_config.rsindex 1e0b27b4f..73071c98d 100644--- a/crates/screenpipe-engine/src/recording_config.rs+++ b/crates/screenpipe-engine/src/recording_config.rs@@ -295,7 +295,7 @@ impl RecordingConfig {ignore_incognito_windows: self.ignore_incognito_windows,pause_on_drm_content: self.pause_on_drm_content,languages: self.languages.clone(),- max_snapshot_width: self.max_snapshot_width,+ video_quality: self.video_quality.clone(),}}}diff --git a/crates/screenpipe-engine/src/vision_manager/manager.rs b/crates/screenpipe-engine/src/vision_manager/manager.rsindex 8e98ad43d..e6a3c7290 100644--- a/crates/screenpipe-engine/src/vision_manager/manager.rs+++ b/crates/screenpipe-engine/src/vision_manager/manager.rs@@ -40,8 +40,10 @@ pub struct VisionManagerConfig {pub pause_on_drm_content: bool,/// Languages for OCR recognition.pub languages: Vec<screenpipe_core::Language>,- /// Maximum width for stored snapshots (0 = no limit, store at native res).- pub max_snapshot_width: u32,+ /// Single user-facing quality preset that drives both JPEG quality and+ /// snapshot max width via `screenpipe_core::video::*`. Values: "low",+ /// "balanced" (default), "high", "max".+ pub video_quality: String,}/// Status of the VisionManager@@ -301,16 +303,25 @@ impl VisionManager {let device_name = format!("monitor_{}", monitor_id);// Create snapshot writer for this monitor's data directory.- // Use current power profile's JPEG quality instead of hardcoded 80.+ //+ // Both knobs (JPEG quality + max width) are derived from the user's+ // single `videoQuality` setting via `screenpipe_core::video` — that+ // way "high"/"max" actually means high/max on disk too, instead of+ // the old behavior where the resolution cap was a separate hidden+ // field defaulting to 1920px (which crushed text on ultrawides).+ // The power profile can still drop quality further at runtime when+ // we're on battery / thermally throttled.+ use crate::video::{video_quality_to_jpeg_quality, video_quality_to_max_snapshot_width};+ let baseline_q = video_quality_to_jpeg_quality(&self.config.video_quality);let initial_jpeg_quality = self.power_profile_rx.as_ref()- .map(|rx| rx.borrow().jpeg_quality)- .unwrap_or(80);+ .map(|rx| rx.borrow().jpeg_quality.min(baseline_q))+ .unwrap_or(baseline_q);let snapshot_writer = Arc::new(SnapshotWriter::new(format!("{}/data", output_path),initial_jpeg_quality,- self.config.max_snapshot_width,+ video_quality_to_max_snapshot_width(&self.config.video_quality),));// Create activity feed for this monitor@@ -330,8 +341,13 @@ impl VisionManager {..TreeWalkerConfig::default()};- // Event-driven capture config- let capture_config = EventDrivenCaptureConfig::default();+ // Event-driven capture config — seed jpeg_quality from the user's+ // chosen videoQuality so power-profile updates can use it as the+ // baseline ceiling (`min(profile, baseline)`) at runtime.+ let capture_config = EventDrivenCaptureConfig {+ jpeg_quality: baseline_q,+ ..EventDrivenCaptureConfig::default()+ };// Subscribe to the shared broadcast channel so UI events reach this monitorlet trigger_rx = self.trigger_tx.subscribe();@@ -486,7 +502,7 @@ mod tests {ignore_incognito_windows: false,pause_on_drm_content: false,languages: vec![Language::English],- max_snapshot_width: 0,+ video_quality: "balanced".to_string(),};VisionManager::new(config, db, Handle::current())}