-
Notifications
You must be signed in to change notification settings - Fork 74
Fix recording with rotated monitors #313
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
Conversation
Just a .2 cents worth comment: I use sway and with
These info are exposed by the compositor (in this case |
I suppose that wf-recorder could be packaged with a python script which connects via pywayfire ipc to get the output information (as a way to side-step having wf-recorder reinvent the ipc wheel in C++, though maybe it could live in ipc.cpp). It could be supplied an output name and and then output the current transform for it. However, this would require ipc + ipc-rules to be enabled and wayfire be patched to yield this information when queried. |
Actually, this patch gets the transform of outputs upfront (and when they change). If you can pipe that into the transform, it should be automatic. |
I actually realized right after I opened this that I'll work on this using @soreau's patch above and update this when I make headway. |
This version of the patch removes variable names that are unused to avoid warnings. |
Alright, I've pushed a couple of commits to handle rotation automatically, but I will have to spin my monitor around in circles and do a bunch of testing to account for all the possible cases. If anyone wants to build and test with 90 and 270 rotations for now, it would be much appreciated. |
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.
Overall it looks good to me, aside from the two minor things I commented on.
I'm going to move the switch statement into Edit: couldn't move it into contained_in as the x and y values need to be modified outside of its scope. I've cleaned it up a bit and will add some better console output and also account for more transform settings tomorrow afternoon. |
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 shaping up, but there a few things that need attention.
The goal of this PR is not to apply transposition. It is to fix the handling of coordinates which do not work in a logical way when a monitor is rotated. |
This already works. What version of wayfire are you using? If you can use wayfire latest git, this would be optimal. |
I am not using wayfire, I'm using hyprland. Nothing in this project hints at being exclusive to wayfire users. |
Can you or anyone test with wayfire? Maybe this is an issue with some other compositors but not wayfire. |
Can you test with Aquamarine? If this project is only meant to support Wayfire, perhaps the readme should be updated to not confuse users of other compositors. |
I refuse to install any untrusted software on my machine.
It is meant to support any compositor that properly implements the wlr_screencopy protocol. |
thank you @dotaxis anyway for kicking off the work to fix the issue. That's really appreciated! 🙂 |
I wonder if |
@dotaxis I have tested wf-recorder with sway+slurp and coordinates work normally. Maybe Hyprland/Aquamarine do not handle the rotation correctly. In any case, since it works on Sway/Wayfire, if we include patches to make it work on Hyprland, it would break the other compositors. And this project is aimed first and foremost at wlroots-based compositors. Unless I am mistaken, is there anyone who is having issues (beyond the video being transposed) on Sway / River / Wayfire / etc ? |
I have tested sway and wayfire with 90 rotation - both work with grim or wf-recorder using slurp. If you are having this issue, can you try with |
Addresses #173
Not sure this is the best way to go about this, but open to suggestions.
Only tested with 90 and 270 degree rotations because I can't handle mirroring. I guess I could add 180 degree rotation without too much work.
Still requires
-F transpose=
to be used get the actual output file to be rotated accordingly.wf-recorder -F transpose=1 --transform 1 -g "107,2000 1247x532" -f ~/Videos/test.mp4
works as expected on a monitor rotated 90 degrees, and coordinates grabbed viaslurp
.wf-recorder -F transpose=2 --transform 3 -g "107,2000 1247x532" -f ~/Videos/test.mp4
works the same when using 270 degree rotation.