From 2faf9715bebe720ed75ce98f5f8c2b2b1532880a Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Wed, 26 Jan 2022 10:47:08 +0100 Subject: [PATCH] Add server option raw_video_stream For convenience, this new option forces the 3 following options: - send_device_meta=false - send_frame_meta=false - send_dummy_byte=false This allows to send a raw H.264 stream on the video socket. Concretely: adb push scrcpy-server /data/local/tmp/scrcpy-server.jar adb forward tcp:1234 localabstract:scrcpy adb shell CLASSPATH=/data/local/tmp/scrcpy-server.jar \ app_process / com.genymobile.scrcpy.Server 1.21 \ raw_video_stream=true tunnel_forward=true control=false As soon as a client connects via TCP to localhost:1234, it will receive the raw H.264 stream. Refs #1419 comment PR #2971 --- server/src/main/java/com/genymobile/scrcpy/Server.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/src/main/java/com/genymobile/scrcpy/Server.java b/server/src/main/java/com/genymobile/scrcpy/Server.java index d9c22771..68c6c02c 100644 --- a/server/src/main/java/com/genymobile/scrcpy/Server.java +++ b/server/src/main/java/com/genymobile/scrcpy/Server.java @@ -253,6 +253,14 @@ public final class Server { boolean sendDummyByte = Boolean.parseBoolean(value); options.setSendDummyByte(sendDummyByte); break; + case "raw_video_stream": + boolean rawVideoStream = Boolean.parseBoolean(value); + if (rawVideoStream) { + options.setSendDeviceMeta(false); + options.setSendFrameMeta(false); + options.setSendDummyByte(false); + } + break; default: Ln.w("Unknown server option: " + key); break;