Problem
Capture is Windows-only. start_recording and screenshot hardcode -f gdigrab (src/utils/targets.ts: buildCaptureArgs / buildScreenshotArgs / targetInputArgs), and target resolution uses Windows APIs (src/utils/monitors.ts via PowerShell, src/utils/windows.ts for window bounds, wired in src/utils/resolveTarget.ts).
The watch, edit, redact, and produce tools already run anywhere ffmpeg does. Only capture is pinned to Windows.
Proposed backends
Selected by process.platform:
win32 -> gdigrab (current).
linux -> x11grab: -f x11grab -framerate N -video_size WxH -i $DISPLAY+X,Y. Native offset/region, mirrors gdigrab closely (lowest-risk first target).
darwin -> avfoundation: -f avfoundation -framerate N -i "<screen-index>". No native offset, so a region: needs -vf crop=w:h:x:y over a full-screen grab; needs screen-recording permission (TCC); the screen device index comes from ffmpeg -f avfoundation -list_devices true -i "".
Architecture sketch
- Add a host-platform helper (overridable via env for tests).
- Refactor
targetInputArgs into a backend-aware captureInputArgs(target, platform, monitors) and thread a platform option through buildCaptureArgs / buildScreenshotArgs, so the pure builders stay unit-testable for all three platforms on any host.
- Per-platform monitor enumeration: keep Windows (
getMonitors), add Linux via xrandr and macOS via the avfoundation device list.
window: targets and system audio stay Windows-only initially (they need xdotool / BlackHole / pulse), with a clear error on other platforms.
Suggested sequencing
- Linux (x11grab) first; scope to video
full / monitor / region.
- macOS (avfoundation) as a follow-up.
Testing reality
The pure arg-builders are fully unit-testable by injecting platform. Actual x11grab / avfoundation runtime can only be verified on those OSes, not from the Windows dev box.
Scope decisions (from planning)
- Video
full / monitor / region cross-platform; window: + system audio stay Windows-only initially.
Recorded from a planning session; not yet scheduled for implementation.
Problem
Capture is Windows-only.
start_recordingandscreenshothardcode-f gdigrab(src/utils/targets.ts:buildCaptureArgs/buildScreenshotArgs/targetInputArgs), and target resolution uses Windows APIs (src/utils/monitors.tsvia PowerShell,src/utils/windows.tsfor window bounds, wired insrc/utils/resolveTarget.ts).The watch, edit, redact, and produce tools already run anywhere ffmpeg does. Only capture is pinned to Windows.
Proposed backends
Selected by
process.platform:win32-> gdigrab (current).linux-> x11grab:-f x11grab -framerate N -video_size WxH -i $DISPLAY+X,Y. Native offset/region, mirrors gdigrab closely (lowest-risk first target).darwin-> avfoundation:-f avfoundation -framerate N -i "<screen-index>". No native offset, so aregion:needs-vf crop=w:h:x:yover a full-screen grab; needs screen-recording permission (TCC); the screen device index comes fromffmpeg -f avfoundation -list_devices true -i "".Architecture sketch
targetInputArgsinto a backend-awarecaptureInputArgs(target, platform, monitors)and thread aplatformoption throughbuildCaptureArgs/buildScreenshotArgs, so the pure builders stay unit-testable for all three platforms on any host.getMonitors), add Linux viaxrandrand macOS via the avfoundation device list.window:targets and systemaudiostay Windows-only initially (they needxdotool/ BlackHole / pulse), with a clear error on other platforms.Suggested sequencing
full/monitor/region.Testing reality
The pure arg-builders are fully unit-testable by injecting
platform. Actual x11grab / avfoundation runtime can only be verified on those OSes, not from the Windows dev box.Scope decisions (from planning)
full/monitor/regioncross-platform;window:+ system audio stay Windows-only initially.Recorded from a planning session; not yet scheduled for implementation.