Git Product home page Git Product logo

node-scrcpy-client's Introduction

node-scrcpy-client

Node.js client for scrcpy server (https://github.com/Genymobile/scrcpy). scrcpy allows you to record your android device / emulator screen. It does not need root access.

Installation

This module is installed via npm:

npm install --save scrcpy-client

Usage

Obtain raw frames

It will connect to adb server, push the jar to the device and emit events with the h264 frames.

const Scrcpy = require('scrcpy-client');

const scrcpy = new Scrcpy();

scrcpy.on('data', (pts, data) => console.log(`[${pts}] Data: ${data.length}b`));

scrcpy.start()
  .then(info => console.log(`Started -> ${info.name} at ${info.width}x${info.height}`))
  .catch(e => console.error('Impossible to start', e));

Configuration options

  {
    adbHost: 'localhost',
    adbPort: 5037,
    deviceId: null,
    port: 8099,
    maxSize: 600,
    bitrate: 999999999,
    tunnelForward: true,
    crop: '9999:9999:0:0',
    sendFrameMeta: true
  }
  • If deviceId is not defined (or null) it will try to use the first device available.
  • If sendFrameMeta is true data events will contain 2 parameters pts and data.

More examples

You can find them in the examples folder.

Enable debug of module

This module uses debug for debugging, you can enable debug messages with:

DEBUG=scrcpy

Run tests

npm test

License (MIT)

In case you never heard about the MIT license.

See the LICENSE file for details.

All credits for scrcpy server goes to Genymobile. The compiled version distributed with this library is a mirror of their built, not compiled by me, to ensure SHA1 signature remains the same and comes from a trust source.

node-scrcpy-client's People

Contributors

jvictorsoto avatar

Watchers

James Cloos 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.