feat(recording): FFmpeg backend for Windows/macOS (CFR + HW encode) #74
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements the FFmpeg-based recording backend proposed in #69.
MediaRecorderto produce higher quality, constant frame rate (CFR) MP4/H.264.Closes #69.
Key changes
Main process: FFmpeg recorder
electron/recording/ffmpegRecorder.ts(FfmpegRecorder)ffmpegfor capture and encoding.qto stdin, with a kill timeout fallback.ffprobeafter stopping to return basic metadata (codec / size / fps) for a lightweight self-check.h264_nvenc/h264_amf/h264_qsv?libx264h264_videotoolbox?libx264-vf fps=...and normalizes output dimensions to even numbers.IPC + preload API
start-recording/stop-recording(FFmpeg backend)electronAPI.startRecording()/electronAPI.stopRecording()Renderer integration (fallback preserved)
useScreenRecorderprefers the FFmpeg backend when available and supported:screen:andwindow:sourcesscreen:sources onlyWindows window-capture improvements
rawName) from the source selector and tries it first forgdigrab title=...matching.Robustness
Automated verification (no screen capture required)
scripts/verify-ffmpeg.mjsandnpm run verify:ffmpeglavfiand validates the MP4 output viaffprobe.Manual verification
macOS
ffmpegandffprobeare available in PATH (or setOPENSCREEN_FFMPEG_PATH/OPENSCREEN_FFPROBE_PATH).npm run dev.Windows
ffmpegandffprobeare available in PATH (or set env overrides).npm run dev.Notes / limitations
Configuration
OPENSCREEN_FFMPEG_PATHOPENSCREEN_FFPROBE_PATH