Help required to simulate working of scrcpy-server.jar #131
Replies: 10 comments
-
|
*Step 2:
*Step 3:
Or you can skip it and connect to But you will not see anything in What exactly are you trying to achieve? |
Beta Was this translation helpful? Give feedback.
-
|
i want to create similar to below project for ws-scrcpy https://github.com/DeviceFarmer/minicap run jar in terminal(command line) ws-scrcpy is too big to understand. |
Beta Was this translation helpful? Give feedback.
-
|
Still dont receive any data: step 1: Response: [server] DEBUG: Server started! ::/:::8886 step 2: var webSocket = new WebSocket('ws://127.0.0.1:8666'); Response: error Error: socket hang up |
Beta Was this translation helpful? Give feedback.
-
|
Server in const ws = new WebSocket(`ws://127.0.0.1:8886/`);
ws.binaryType = 'arraybuffer';
ws.onmessage = function(data) { console.log(data); };Code: ws-scrcpy/src/app/client/ManagerClient.ts Lines 29 to 37 in 67cc51c ws-scrcpy/src/app/client/StreamReceiver.ts Lines 50 to 51 in 67cc51c Or you might want to use original
|
Beta Was this translation helpful? Give feedback.
-
|
Tried but no luck Step 1: adb shell 'CLASSPATH=/data/local/tmp/scrcpy-server.jar app_process / com.genymobile.scrcpy.Server 1.17-ws5 web DEBUG 8886' Response: [server] DEBUG: Server started! ::/:::8886 step 2: const WebSocket = require('ws'); const ws = new WebSocket( error: events.js:200 Error: connect ECONNREFUSED 127.0.0.1:8886 |
Beta Was this translation helpful? Give feedback.
-
|
You must either forward port to localhost ( adb forward tcp:8886 tcp:8886or connect to device directly const ip = '192.168.1.101'; // change to your ip address here
const ws = new WebSocket(`ws://${ip}:8886/`) |
Beta Was this translation helpful? Give feedback.
-
|
adb shell 'killall app_process' adb shell 'CLASSPATH=/data/local/tmp/scrcpy-server.jar app_process / com.genymobile.scrcpy.Server 1.17-ws5 web DEBUG 8886' adb forward tcp:8886 tcp:8886 const WebSocket = require('ws'); const ws = new WebSocket( ws.binaryType = 'arraybuffer'; worked. |
Beta Was this translation helpful? Give feedback.
-
|
why buffer is not continues? how do i display to browser? |
Beta Was this translation helpful? Give feedback.
-
|
should i send any message to websocket to receive video buffer array in non-stop? |
Beta Was this translation helpful? Give feedback.
-
|
After connection you should receive initial info: ws-scrcpy/src/app/client/StreamReceiver.ts Lines 131 to 135 in 67cc51c To start stream you must send ControlMessage.TYPE_CHANGE_STREAM_PARAMETERS message:ws-scrcpy/src/app/googDevice/client/StreamClientScrcpy.ts Lines 207 to 211 in 67cc51c |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Can you please help me capture buffer data from scrcpy-server.jar
Step 1 :
adb push dist/server/vendor/Genymobile/scrcpy/scrcpy-server.jar /data/local/tmp
Step 2:
adb shell 'CLASSPATH=/data/local/tmp/scrcpy-server.jar app_process / com.genymobile.scrcpy.Server 1.17-ws5 DEBUG 0 8000000 60 -1 false - false true 0 false false - web 8886'
error:
[server] ERROR: Exception on thread Thread[main,5,main]
java.lang.IllegalArgumentException: Expecting 15 parameters
at com.genymobile.scrcpy.Server.parseArguments(Server.java:43)
at com.genymobile.scrcpy.Server.main(Server.java:152)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:409)
Step 3:
adb forward tcp:8666 localabstract:scrcpy
Step 4:
nc localhost 8666
Beta Was this translation helpful? Give feedback.
All reactions