Skip to content

feat(cli): add --disable-snapshot-compaction to skip JPEG→MP4 worker#3385

Merged
louis030195 merged 1 commit into
screenpipe:mainfrom
rhodium-inc:pr/disable-snapshot-compaction
May 14, 2026
Merged

feat(cli): add --disable-snapshot-compaction to skip JPEG→MP4 worker#3385
louis030195 merged 1 commit into
screenpipe:mainfrom
rhodium-inc:pr/disable-snapshot-compaction

Conversation

@rhodium-inc
Copy link
Copy Markdown
Contributor

Summary

Add an opt-in --disable-snapshot-compaction CLI flag (and matching disableSnapshotCompaction settings field) that skips the background JPEG→MP4 snapshot compaction worker.

Motivation

The snapshot compaction worker compresses older JPEG frames into H.265 MP4 chunks every 5 minutes (great for users browsing the MP4 timeline UI, ~10-30x size reduction).

However, for tools that only consume accessibility_text and ui_events (task-mining tools, automation, headless analysis pipelines), the worker is pure overhead:

  • ffmpeg H.265 encoding visibly bumps CPU usage every 5 minutes
  • The generated MP4s are never read
  • Disk savings can be achieved via --retention-days instead

--disable-vision already exists but is too coarse — it also skips OCR / accessibility capture, which we still need.

Behavior

  • Default: false — no change for existing users
  • When set:
    • start_snapshot_compaction is not called
    • Startup log prints: snapshot compaction disabled via --disable-snapshot-compaction
    • Individual JPEGs persist until --retention-days cleans them up

Implementation

  • `screenpipe-config`: `RecordingSettings.disable_snapshot_compaction` (persisted to settings.json via `disableSnapshotCompaction`)
  • `screenpipe-engine/cli`: `--disable-snapshot-compaction` flag on `record` subcommand
  • `screenpipe-engine/recording_config`: `RecordingConfig` propagation
  • `screenpipe-engine/bin`: gate `start_snapshot_compaction()` call

Validation

  • `cargo build --release --target x86_64-pc-windows-msvc --workspace --exclude screenpipe-rfdetr-mlx` passes on Windows (rebased onto current main, includes [codex] fix Windows ONNX Runtime version #3370)
  • `screenpipe record --help` shows the new flag
  • 15-minute run with `--disable-snapshot-compaction --disable-audio` confirmed:
    • No `snapshot compaction worker started` log line
    • No MP4 files produced
    • JPEGs accumulate as expected (cleaned later by retention)

Context

This is the first of a few small CLI flags we're adding for task-mining / headless-recording use cases. Submitted as a small, isolated PR to keep review easy.

Add an opt-in flag to skip the background snapshot_compaction worker
that compresses older JPEG frames into H.265 MP4 chunks every 5 minutes.

For users who don't consume the MP4 timeline UI (task-mining tools,
headless analysis pipelines, agents that read accessibility_text and
ui_events only), the worker is pure overhead — ffmpeg H.265 encoding
visibly bumps CPU on lower-tier machines while the generated MP4s are
never read. `--disable-vision` already exists but is too coarse since
it also skips OCR / accessibility capture.

The flag is opt-in (default false), so existing users are unaffected.
When set, individual JPEGs remain on disk and disk usage is bounded by
`--retention-days` instead of compaction.

Implementation:
- screenpipe-config: RecordingSettings.disable_snapshot_compaction (persisted)
- screenpipe-engine/cli: --disable-snapshot-compaction
- screenpipe-engine/recording_config: RecordingConfig propagation
- screenpipe-engine/bin: gate start_snapshot_compaction() call

Validated by:
- cargo build --release --target x86_64-pc-windows-msvc --workspace --exclude screenpipe-rfdetr-mlx
- screenpipe record --help shows the new flag
- 15-minute run with --disable-snapshot-compaction --disable-audio confirmed
  no compaction worker started and no MP4 files produced

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants