perf(macos): add high-FPS ScreenCaptureKit VideoToolbox path#5267
Open
bdjben wants to merge 1 commit into
Open
perf(macos): add high-FPS ScreenCaptureKit VideoToolbox path#5267bdjben wants to merge 1 commit into
bdjben wants to merge 1 commit into
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.




Description
Adds a macOS ScreenCaptureKit display capture path and a native
VTCompressionSessionVideoToolbox encoder path for high-FPS streaming. The encode loop is paced from an independent output clock so streams can continue emitting encoded frames at the requested cadence even when macOS capture delivers fresh frames at a lower rate.This also preserves the client-requested stream dimensions, includes the cursor in ScreenCaptureKit output, and adds capture/encode/send rate logging useful for diagnosing macOS high-FPS behavior.
Local validation was done on an Apple Silicon Mac mini with a Windows Moonlight client and two simultaneous Sunshine-derived app instances: one stream at 120 FPS and one stream at 60 FPS. The successful run showed approximately 120 FPS and 60 FPS output respectively, with native VideoToolbox reporting
failed_packets=0in the tested windows.Known follow-up areas: the high-FPS pacing strategy is intentionally aggressive and should be reviewed for CPU efficiency, and broader testing is needed across macOS versions, display configurations, codecs, HDR/SDR modes, and client settings.
Screenshot
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage