Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
112.39k stars 10.74k forks source link

When casting Oculus Quest Pro to Windows, the screen content is rotated approximately 30 degrees. #4135

Open zhang-1999 opened 1 year ago

zhang-1999 commented 1 year ago

Environment

Describe the bug When casting Oculus Quest Pro to Windows, the screen content is rotated approximately 30 degrees.

BTW,Oculus Quest 2 works well.

scrcpy --no-audio --crop 1730:974:1934:450

img_v2_7d326f7b-9854-4896-8c0e-e21117c896fg

rom1v commented 1 year ago

This is how the content is rendered on Android.

zhang-1999 commented 1 year ago

Sorry, I didn't quite understand what you meant. Did you meant that the content is rendered on Oculus Quest Pro is correctly ? If yes,you saying that scrcpy cannot solve this problem?

Did scrcpy provide a cli arg to rotate the video stream ?

rom1v commented 1 year ago

Scrcpy captures what is rendered on the "surface". How the screen content is "transformed" by the Oculus device to display correctly for each eye is out of control of scrcpy. In theory, it could be possible to apply the same "warp" transformation, but it must be known (estimated), and scrcpy does not support such a feature anyway.

It can only rotate by multiples of 90°: https://github.com/Genymobile/scrcpy/blob/master/doc/video.md#rotation

zhang-1999 commented 1 year ago

Thanks for you reply . Could you provide a more granular cli argument about "rotation",for example :

scrcpy --lock-video-orientation=0  --video-rotation=30
zhang-1999 commented 1 year ago

If you think this feature should not be added to scrcpy , I wanto to know did the proposal is feasible in techonology ? I can try to fork this project to make custom changes if possible

rom1v commented 1 year ago

I wanto to know did the proposal is feasible in techonology ?

Oh, actually SDL_RenderCopyEx() accepts an arbitrary angle, so you can play with that:

https://github.com/Genymobile/scrcpy/blob/625934fb1b078a5d66bc4864e8082840d57d4557/app/src/display.c#L275-L276

zhang-1999 commented 1 year ago

thanks, I will try it

nnnpa31 commented 1 year ago

Sorry, I didn't quite understand what you meant.

(just a speculation, I do not have any evidence) I think the Oculus Quest Pro's display is physically rotated by 30 degrees (or 45 degrees) to the point where the display needs to be reversed by a certain angle to properly display the binoculars.

Mar2ck commented 1 year ago

It's a trick to prevent the screen door effect. The screens for each eye in the Quest Pro are rotated 30 degrees in opposite directions which means the pixel grid for each eye no longer lines up and therefore isn't as visible.

rolandwellinger commented 1 year ago

@zhang-1999 Do you got any success rotating the image for Quest Pro / Quest 3?

polyzium commented 10 months ago

I have a Quest 3 and Meta did the exact same trick with the panels. I wonder if this is possible to do via SDL_gfx or OpenGL, or possibly a homegrown transformation algorithm. Possibly could learn something from OBS since it has transforms as essential functionality.

rolandwellinger commented 9 months ago

Hi All. Thank you so much for addressing this issue. When is this comming to release? I like to use scrcpy and hopefully later on SideQuest to Stream Again from the HMD.

rom1v commented 4 days ago

Please test #5455 and the new --angle option.