omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Screenrecording of selected area wrong on external HDMI monitor

Open EERomeo opened this issue 9 months ago • 8 comments

System details

AMD Ryzen 7 7735HS, Nvidia RTX 4060, Omarchy 3.4.0 stable

What's wrong?

When trying to screenrecord and choosing Region > Select region if on external HDMI monitor, the recorded area is wrong. In the test I selected an area on the left part of the screen, the recording is on the right part and going half off screen. If I try it on the eDP monitor it records the selected area fine. I have not test this on previous versions. My monitors.conf:

monitor = eDP-1, 1980x1080@165, auto, 1
monitor = HDMI-A-1, 3440x1440@100, auto, 1

https://github.com/user-attachments/assets/50d07175-f05d-44ba-b062-24b40109bb1e

EERomeo avatar Feb 28 '26 12:02 EERomeo

Updated to 3.4.1 - the problem is still present.

EERomeo avatar Feb 28 '26 18:02 EERomeo

this is a problem with how gpu-screen-recorder interprets the portal output from /usr/bin/hyprland-share-picker

@EERomeo try these two commands, I'm guessing the one with slurp will work correctly, I'm seeing the same problem after hooking up an extra monitor, I didn't see it before

broken (like in omarchy-cmd-screenrecord): gpu-screen-recorder -w portal -f 60 -fm cfr -fallback-cpu-encoding yes -o test.mp4

working as expected (using slurp to instead select the region i want to record): gpu-screen-recorder -w "$(slurp | awk '{split($1,a,","); print $2 "+" a[1] "+" a[2]}')" -f 60 -fm cfr -fallback-cpu-encoding yes -o test2.mp4

here is the output of both the hyprland picker and slurp of the same region I used to test the above:

~ ❯ /usr/bin/hyprland-share-picker
[SELECTION]/region:DP-1@3058,1310,1146,1214

~ ❯ slurp
4973,1312 1152x1216

ogarza avatar Mar 19 '26 18:03 ogarza

I'm guessing the problem is slurp is absolute... that 4973 in slurp includes the 1920 from the other monitor, where in the hyprland-share-picker it does not

ogarza avatar Mar 19 '26 19:03 ogarza

I kept investigating and the problem a bit more, I was not familiar with either tool... think boils down to the xdg portal service not returning the offset value correctly or the portal not being interpreted correctly by gpu-screen-recorder.. problem is I'm not sure what the contract there is and which is supposed to do what... for now I'm using slurp when i want to capture a region ant its working fine

ogarza avatar Mar 20 '26 01:03 ogarza

Ok, I tested both commands, here's the output:

gpu-screen-recorder -w portal -f 60 -fm cfr -fallback-cpu-encoding yes -o test.mp4
gsr info: option '-w portal' was used without '-restore-portal-session yes'. The previous screencast session will be ignored
gsr info: gsr_capture_portal_setup_dbus: CreateSession
gsr info: gsr_capture_portal_setup_dbus: SelectSources
gsr info: gsr_capture_portal_setup_dbus: Start
gsr info: gsr_capture_portal_save_restore_token: saved restore token to cache (3e3fc21e-51ab-4fa9-a4b1-a8f3a6db1d3a)
gsr info: gsr_capture_portal_setup_dbus: OpenPipeWireRemote
gsr info: gsr_capture_portal_setup_dbus: desktop portal setup finished
gsr info: gsr_capture_portal_setup: setting up pipewire
gsr info: pipewire: server version: 1.6.0
gsr info: pipewire: library version: 1.6.0
gsr info: pipewire: header version: 1.4.10
gsr info: pipewire: stream 0x557ddffb2e20 previous state: "unconnected", new state: "connecting" (error: none)
gsr info: gsr_capture_portal_setup: pipewire setup finished
gsr info: gsr_capture_portal_start: waiting for pipewire negotiation
gsr info: pipewire: stream 0x557ddffb2e20 previous state: "connecting", new state: "paused" (error: none)
gsr info: pipewire: negotiated format:
gsr info: pipewire:    Format: 12 (Spa:Enum:VideoFormat:BGRA)
gsr info: pipewire:    Modifier: 0x0
gsr info: pipewire:    Size: 910x678
gsr info: pipewire:    Framerate: 0/1
gsr info: pipewire: negotiated format:
gsr info: pipewire:    Format: 12 (Spa:Enum:VideoFormat:BGRA)
gsr info: pipewire:    Modifier: 0x20000001056bb03
gsr info: pipewire:    Size: 910x678
gsr info: pipewire:    Framerate: 0/1
gsr info: pipewire: stream 0x557ddffb2e20 previous state: "paused", new state: "streaming" (error: none)
gsr error: gsr_pipewire_video_create_egl_image_with_fallback: failed to create egl image with modifier 0x20000001056bb03, renegotiating with a different modifier
gsr info: pipewire: stream 0x557ddffb2e20 previous state: "streaming", new state: "paused" (error: none)
gsr info: pipewire: negotiated format:
gsr info: pipewire:    Format: 12 (Spa:Enum:VideoFormat:BGRA)
gsr info: pipewire:    Modifier: 0x20000001056bb03
gsr info: pipewire:    Size: 910x678
gsr info: pipewire:    Framerate: 0/1
gsr info: pipewire: negotiated format:
gsr info: pipewire:    Format: 12 (Spa:Enum:VideoFormat:BGRA)
gsr info: pipewire:    Modifier: 0x200000010567b03
gsr info: pipewire:    Size: 910x678
gsr info: pipewire:    Framerate: 0/1
gsr info: pipewire: stream 0x557ddffb2e20 previous state: "paused", new state: "streaming" (error: none)
gsr error: gsr_pipewire_video_create_egl_image_with_fallback: failed to create egl image with modifier 0x200000010567b03, renegotiating with a different modifier
gsr info: pipewire: stream 0x557ddffb2e20 previous state: "streaming", new state: "paused" (error: none)

and

REGION=$(slurp -d -c '#ff000080' -w 2) && gpu-screen-recorder -w "$(echo "$REGION" | awk '{print $2 "+" $1}' | tr ',' '+')" -f 60 -fm cfr -fallback-cpu-encoding yes -o test2.mp4
gsr info: gsr_kms_client_init: setting up connection to /usr/bin/gsr-kms-server
gsr info: gsr_kms_client_init: waiting for server to connect
kms server info: connecting to the client
gsr info: gsr_kms_client_init: server connected
gsr info: replacing file-backed unix domain socket with socketpair
kms server info: connected to the client
gsr info: using socketpair
gsr error: gsr_capture_kms_start: failed to find monitor by name "HDMI-A-1"
gsr error: gsr_capture_start failed

For me it's not a big deal, I don't use this almost at all, just reported a bug. The first command gives the same result as the as you can imagine, the second fails.

Thanks for looking into this!

EERomeo avatar Mar 20 '26 06:03 EERomeo

sorry, my example command was too specific to my monitor which was on DP-1 but I have the same issue as you, for now I created a new hotkey which will launch the same screen recording script but using slurp instead, and I use it when I want to record a region... for selecting a window or a monitor, the regular omarchy implementation works

ogarza avatar Mar 20 '26 17:03 ogarza

Yeah, I know, no problem! All the other recording modes work as you mentioned!

EERomeo avatar Mar 20 '26 17:03 EERomeo

Closing as fixed, resolved, or superseded by the current Quattro implementation based on the open-issue review.

dhh avatar Jul 18 '26 19:07 dhh