-
-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add support for native screen recording #330
Conversation
README.md
Outdated
--- | --- | --- | --- | --- | ||
fps | number | no | Frame Per Second setting for the resulting screen recording. 24 by default. Higher FPS values may significantly increase the size of the resulting video. | 60 | ||
codec | number | no | Possible codec value, where `0` means H264 (the default setting), `1` means HEVC | 1 | ||
displayID | number | no | Valid display identifier to record the video from. Main display ID is assumed by default. Use the `system_profiler -json SPDisplaysDataType` Terminal command to list IDs of connected displays. | 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't test this PR out yet but I saw this displayID could be a string such as b
:
$ system_profiler -json SPDisplaysDataType
{
"SPDisplaysDataType" : [
{
"_name" : "Apple M3",
"_spdisplays_airplay" : "spdisplays_yes",
"spdisplays_mtlgpufamilysupport" : "spdisplays_metal3",
"spdisplays_ndrvs" : [
{
"_name" : "Color LCD",
"_spdisplays_display-product-id" : "a04f",
"_spdisplays_display-serial-number" : "fd626d62",
"_spdisplays_display-vendor-id" : "610",
"_spdisplays_display-week" : "0",
"_spdisplays_display-year" : "0",
"_spdisplays_displayID" : "1",
"_spdisplays_pixels" : "3600 x 2338",
"_spdisplays_resolution" : "1800 x 1169 @ 120.00Hz",
"spdisplays_ambient_brightness" : "spdisplays_yes",
"spdisplays_connection_type" : "spdisplays_internal",
"spdisplays_display_type" : "spdisplays_built-in-liquid-retina-xdr",
"spdisplays_main" : "spdisplays_yes",
"spdisplays_mirror" : "spdisplays_off",
"spdisplays_online" : "spdisplays_yes",
"spdisplays_pixelresolution" : "spdisplays_3024x1964Retina"
},
{
"_name" : "Sidecar Display",
"_spdisplays_CGSDID" : "11",
"_spdisplays_display-product-id" : "69506164",
"_spdisplays_display-serial-number" : "8713861c",
"_spdisplays_display-vendor-id" : "6161706c",
"_spdisplays_display-week" : "0",
"_spdisplays_display-year" : "0",
"_spdisplays_displayID" : "b",
"_spdisplays_pixels" : "2204 x 1484",
"_spdisplays_resolution" : "1102 x 742 @ 60.00Hz",
"spdisplays_connection_type" : "spdisplays_airplay",
"spdisplays_depth" : "CGSThirtytwoBitColor",
"spdisplays_mirror" : "spdisplays_off",
"spdisplays_pixelresolution" : "2204 x 1484",
"spdisplays_resolution" : "1102 x 742 @ 60.00Hz",
"spdisplays_virtualdevice" : "spdisplays_yes"
}
],
"spdisplays_vendor" : "sppci_vendor_Apple",
"sppci_bus" : "spdisplays_builtin",
"sppci_cores" : "10",
"sppci_device_type" : "spdisplays_gpu",
"sppci_model" : "Apple M3"
}
]
}%
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, the secondary one is 11:
(lldb) po XCUIScreen.screens
<__NSArrayM 0x6000024f8330>(
XCUIScreen (displayID: 1, main: YES),
XCUIScreen (displayID: 11, main: NO)
)
So, I think it would be nice to add an endpoint to return available screen info with displayID => oh, the error message returns available ones (verifyDisplayWithID
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's in hex notation: b
hex == 11
decimal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, noticed that:
python3 -c "print(int('b', 16))"
11
Maybe we could guide here to try out macos:screenshots
also to check display IDs and corresponding screenshots to help detect the target display id especially with external dispkays?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a separate execute method to list available displays info as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lg, the implementation was similar to iOS's WDA
## [2.1.0](v2.0.0...v2.1.0) (2025-02-07) ### Features * Add support for native screen recording ([#330](#330)) ([d2f5b25](d2f5b25))
🎉 This PR is included in version 2.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
No description provided.