Giter Site home page Giter Site logo

redburn82 / jsmpeg-vnc-linux Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thesauri/jsmpeg-vnc-linux

1.0 0.0 0.0 24.44 MB

참고용: screen grabber 방법 window -> x11로 변경된 것; 안드로이드용으로 바꿔야 함. (혹시몰라 현재 상태에서 고정)

JavaScript 73.46% C 23.72% HTML 1.51% CMake 0.43% Dockerfile 0.89%

jsmpeg-vnc-linux's Introduction

jsmpeg-vnc-linux

A semi-complete Linux port of jsmpeg-vnc.

Compiling on Ubuntu 20.04

Install the following packages:

  • build-essential
  • libx11-dev
  • libx11-dev
  • libavutil-dev
  • libavcodec-dev
  • libswscale-dev
  • libxtst-dev
  • libssl-dev
  • pkg-config
  • zlib1g-dev

In addition to this, compile and install libwebsockets 4.1.

Then, run the following commands in the root directory:

cmake .
make

See the Dockerfile for an example on how to install the dependencies, compile libwebsockets, and compile jsmpeg-vnc-linux (it won't run out-of-the-box in Docker though, as there is nothing to stream).

Running

jsmpeg-vnc [options] <window name>

Options:
  -b bitrate in kilobit/s (default: estimated by output size)
  -s output size as WxH. E.g: -s 640x480 (default: same as window size)
  -f target framerate (default: 60)
  -p port (default: 8080)
  -c crop area in the captured window as X,Y,W,H. E.g.: -c 200,300,640,480
  -i enable/disable remote input. E.g. -i 0 (default: 1)

Use "desktop" as the window name to capture the whole Desktop. Use "cursor"
to capture the window at the current cursor position.

Example:
jsmpeg-vnc -b 2000 -s 640x480 -f 30 -p 9006 "Quake 3: Arena"

To enable mouse lock in the browser (useful for games that require relative
mouse movements, not absolute ones), append "?mouselock" at the target URL
i.e: http://<server-ip>:8080/?mouselock

(Copied from the parent project)

About

For a project I was working on I needed a way to stream desktop applications to the web browser. I tried creating a video stream using ffmpeg, but I quickly discovered that support of live video streaming was rather poor using only <video> tags. For interaction with desktop applications, the latency was too high (after a long battle to get it working at all). I then discovered the project jsmpeg-vnc which suited my needs very well. By creating a video stream, sending it over a WebSocket, and rendering the video onto a canvas element using JavaScript control was given over the screen capturing and rendering. That way, the latency could be minimized and the framerate kept high.

Unfortunately, the jsmpeg-vnc project grabbed screen data using the Windows API. The project I was working on would be run on a Linux-based server. Thus, I ported the software to grab screen data using the X11 library instead.

Ported

Sharing the whole desktop.

Not ported

Sharing individual application windows and areas around the cursor.

Known issues

No windows appear with GNOME/Unity, only the wallpaper is shown. Works with LXDE though. (http://stackoverflow.com/questions/37972928/xgetimage-captures-wallpaper-but-no-windows-c-x11)

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.