Giter Site home page Giter Site logo

ss's Introduction

根据scrcpy和wfs做的手机投影web端demo服务端

服务端口号:默认8888,Application里面可以修改

scrcpy-server在根目录下,版本1.14

scrcpy adb forward 端口号默认27183 可以在MyWebSocket中修改

代码

MyWebSocket 前后端websocket ScrServer scrcpy操作入口类 StreamCollector 收集视频流,切割,放入队列 StreamSender 队列中取数据,发送

流程

push包到手机,forward端口,执行命令

  • adb push scrcpy-server /data/local/tmp/scrcpy-server.jar
  • adb forward tcp:27183 localabstract:scrcpy
  • adb shell CLASSPATH=/data/local/tmp/scrcpy-server.jar app_process / com.genymobile.scrcpy.Server 1.14 info 0 12441600 20 -1 true 1080:1920:0:0 false true 0 false false -

创建2个socket,建立视频和操作链接

  • socketVideo = new Socket("localhost", PORT);
  • socketControl = new Socket("localhost", PORT);

电脑模拟,监听端口

  • nc localhost 27183 //第一个视频流。如果没有数据,说明前3步有问题
  • nc localhost 27183 //操作

测试了一些机型,兼容的

  • 小米note3
  • 华为mate9
  • iqoo
  • 1加3T
  • vivox20 plus

ss's People

Contributors

wengxiaofeng avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.