Skip to content

Feature: Mouse auto-track for cursor-following zoom #7

Description

@amitayks

Summary

Automatic viewport tracking that follows the mouse cursor when zoomed in, creating smooth cinematic pan effects similar to Screen Studio.

Key Features

  • Mouse position recording — during screen capture, the global cursor position is captured at ~20Hz via IPC (screen.getCursorScreenPoint()) and stored as a JSON file alongside the take's recording files
  • Auto-track toggle — per-section per-mode toggle (autoTrack: boolean) on each anchor keyframe. When enabled, manual backgroundPanX/Y is overridden by pan values computed from the mouse trail
  • Smoothing control — configurable autoTrackSmoothing parameter using exponential moving average, letting users control how tightly the viewport follows the cursor (snappy vs cinematic)
  • Editor previewgetStateAtTime() computes backgroundFocusX/Y from the mouse trail when auto-track is on, with real-time preview in the editor
  • FFmpeg render — mouse trail is subsampled to keypoints (~1-2/sec), converted to focus coordinates, and fed through buildNumericExpr() to generate animated zoompan expressions in the ffmpeg filter chain
  • UI controls — auto-track toggle button and smoothing scrub control, visible when a section has zoom > 1.0. Auto-disables when zoom is 1.0 (no panning needed at full size)
  • Per-mode state — auto-track settings are saved independently for landscape and reel modes via MODE_SPECIFIC_PROPS

Why

When users zoom into their screen recording, the viewport is statically positioned — they manually set a pan position per section. But during recording, the most interesting content is usually where the cursor is. Auto-track makes zoomed recordings automatically follow the action.

New Capabilities

  • mouse-trail-capture — cursor position recording during capture, IPC, storage
  • mouse-trail-data — trail lookup, smoothing algorithm, subsampling for render
  • mouse-auto-pan — auto-track mode, focus computation, editor + render integration

Related Commits

  • b5407ca — feat: add mouse auto-track for cursor-following zoom in editor and render

Fixes included in PR #3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions