openstf / minicap

Stream real-time screen capture data out of Android devices.
Other
1.72k stars 623 forks source link

Rotation problem on nodeJs server #128

Open Nicolas-Menettrier opened 6 years ago

Nicolas-Menettrier commented 6 years ago

How to rotate my screen to 90 degrees, i tried 480x800@800x480/90 on the script and other things but nothing worked. When I display the header of the response the 22nd bytes is always set at 0.

Do you have any example for screen rotation ? I used appium to get rotation on the device.

sorccu commented 6 years ago

Read the README. Look at the quirks section. I have a feeling it will explain evrything.

ClaraGrd commented 6 years ago

I have the same problem. I understand that the frame will be always in upright orientation, but how can i change that ? I only have half of the screen. What do you mean by "This needs to be taken into account when rendering the image." ?

screenshot from 2018-04-19 14-54-36

sorccu commented 6 years ago

Your parameters are off. You can’t have the projection in landscape if the real size is portrait. Try STF. Run it with ‘DEBUG=adb* stf local’. Use the device and rotate it, manually is fine. Check how the parameters change.

Nicolas-Menettrier commented 6 years ago

It work only when i manually rotate the device but didn't work with Appium driver.setOrientation() (even if i send the good parameters). Did you ever had this issue ?

Nicolas-Menettrier commented 6 years ago

Ok, to everyone who got this issue on a nodeJs server. I used spawn to launch the script with some parameters but child_process.kill("SIGINT") doesn't really close the process so the client always reconnect to the same minicap server. You need to spawn with option detached=true and kill the process with process.kill(-child_process.pid, "SIGINT").

More information here http://azimi.me/2014/12/31/kill-child_process-node-js.html