NetrisTV / ws-qvh

Server for streaming the screen of iOS devices over WebSocket.
MIT License
31 stars 9 forks source link

if QVH fails, the wda is not starting. possible to run wda in parallel to QVH #5

Open krishtoautomate opened 3 years ago

krishtoautomate commented 3 years ago

if QVH fails, the wda is not starting. possible to run wda in parallel to QVH.

drauggres commented 3 years ago

QVH resets usb connection on startup (and after stopping). We can start WDA only after QVH, that is why client waits for the first frame before requesting to start WDA.

krishtoautomate commented 3 years ago

can you please point me where QVH start and where WDA start after QVH.

drauggres commented 3 years ago

I'm working on integration ws-qvh to ws-scrcpy server. The current architecture soon will be obsolete. I plan to implement like like this (see https://github.com/NetrisTV/ws-scrcpy/pull/91):

As for the current state:

point me where QVH start

Client:

Server: https://github.com/NetrisTV/ws-qvh/blob/a9a487ad1da187b0fa40b7888907f3e93d34fc35/client.go#L163-L164

where WDA start after QVH.

Client:

Server: https://github.com/NetrisTV/ws-qvh/blob/a9a487ad1da187b0fa40b7888907f3e93d34fc35/client.go#L75-L77

krishtoautomate commented 3 years ago

QVH is not working if device screen is off. if WDA starts before QVH or parallel. WDA will allow to call iPhone Home button {{DEVICE_URL}}/wda/homescreen

drauggres commented 3 years ago

You will need to start WDA again if you run it before QVH, because QVH will reset the USB connection. I just keep screens of the connected devices always on, it is much easier.

P.S. Actually, QVH works with the screen off, it will start sending data if you turn on the screen physically.

krishtoautomate commented 3 years ago

Do we need QVH? Webdriveragent can broadcast real time screen at port 9100. RUN wda and open url http://${WDA_SERVER_URL}:9100

drauggres commented 3 years ago

Do we need QVH?

In theory, h264 stream produced by qvh should be more effective, but I didn't do the benchmarks.

Webdriveragent can broadcast real time screen at port 9100. RUN wda and open url http://${WDA_SERVER_URL}:9100

We can add this as separate feature.

krishtoautomate commented 3 years ago

i checked both video quality and i find that using wda video quality is better than QVH

drauggres commented 3 years ago

i checked both video quality and i find that using wda video quality is better than QVH

QVH produces stream with "adaptive" fps (it switches between 30 and 60 fps), but it the client it locked at 30 (src). That's why it may look choppy. By "effective" I didn't mean only video quality. Probably "efficient" is more correct word, i.e. with same video quality h264 stream:

Also qvh sends audio stream, but at the moment I just drop it.

But I will look into mjpeg server later.

krishtoautomate commented 3 years ago

Where do i change the fps of qvh to test different fps to avoid choppyness in video stream.

drauggres commented 3 years ago

Where do i change the fps of qvh to test different fps to avoid choppyness in video stream.

https://github.com/NetrisTV/ws-scrcpy/blob/67cc51c90861cadd1f977f14bc3efe8b5dfa56ca/src/app/player/MsePlayerForQVHack.ts#L11

krishtoautomate commented 3 years ago

possible to run wda though qvh fails?