Giter VIP home page Giter VIP logo

androidmirrroing's Introduction

Android Mirrroing

I have been searching for a way to stream android screen to a web. Finally I've found some amazing tools then I decided to combine them together.

scrcpy is a wonderful tool for streamming in recent days, so I would love to use it as a recorder which captures screen and then outputs a h264 video stream. I connect my android phone to the PC. ADB is used to put the scrcpy server jar to my phone and run it. Next step is to forward scrcpy server to a local port. Please check scrcpy.bat.

h264-live-player is a good base to build a live h264 player. I can use sample servers to run a web-server which serves h264 video by reading stream from a tcp and then decoding it on web. Node.js is used to run the server.

Mirroring Server

This part is a bridge for scrcpy and h264-live-player. I can use the server-tcp.js in package h264-live-player but there is a big problem: only the first client can see the screen!

Therefore, I have to make my own server: read from tcp, handle multi clients, and forward stream to clients. Install required packages with npm install in mirroring folder first.

Run as the project is at just started, the size of a frame is fixed please modify it to fit yours in: mirror.js

ws.send(JSON.stringify({
  action: 'init',
  width: '720',
  height: '1280'
}));

index.html

wsavc.swipe(
  startX * 720 / width,
  startY * 1280 / height, 
  endX * 720 / width, 
  endY * 1280 / height,
  elapsedTime);

run scrcpy.bat first, then run mirror.bat.

androidmirrroing's People

Contributors

vuquangtrong 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.