Coder Social home page Coder Social logo

screencaptureserver's Introduction

ScreenCaptureServer

A Windows tool for sharing desktop screenshots and video-streams via HTTP.
Screenshots are served in JPEG format.
Video-streams are served using Motion-JPEG format.

This project was developed using Microsft Visual Studio 2015.
The server runs properly on Windows 7, Windows 8.1 and Windows 10.

Running the server

Syntax
  ScreenCaptureServer.exe [options]
where 'options' is a combination of:
  -i:<strInterface>      Server interface for accepting connections
                         Default value: ANY
  -p:<nPort>             Server port number for accepting connections
                         Default value: 8080
  -c:<nMaxConnections>   Maximum simultanous connections
                         Default value: 10
  -hide                  Hide console on start
  -minimize              Minimize console on start

Command line examples

To run the server using port 80 (instead of port 8080 -default-) and allowing 5 simultaneous connections maximum (default value is 10), type:

  ScreenCaptureServer.exe -p:80 -c:5

Connecting to the server

HealthCheck mode

Use this mode for checking server connection and getting current native screen size.

http://<server-address>:<server-port>/healthCheck

This request should return an HTTP 200 code including the following JSON payload information:

{
  ip : <server-ip>
  hostname : <server-hostname>
  width : <desktop-width>
  height : <desktop-height>
  caps : <capability-list>
  devices : <display-device-list>
}

To allow cascade connection of devices (i.e.: multiple monitors connected to a graphics card port), one item on the can be nested inside other devices.
Use device "name" value in the HTTP for request to specify screen-capture on a specific display device.

Snapshot mode

http://<server-address>:<server-port>/getImage
  
This request can include aditional parameters:
  * width=<nWidth>      Destination image width. Default value: same as nCX
  * height=<nHeight>    Destination image height. Default value: same as nCY
  * x0=<nX0>            Snapshot window position (horizontal offset). Default value: 0
  * y0=<nY0>            Snapshot window position (vertical offset). Default value: 0
  * cx=<nCX>            Snapshot window width. Default value: Original screen width resolution
  * cy=<nCY>            Snapshot window height. Default value: Original screen height resolution
  * cap=<CAPTURER>      Capturer method to be used
  * dev=<DEVICE_NAME>   Device name to be used for screen capturing
  
Where CAPTURER can be one of these methods:
  * GDI                 Use GDI method to capture the desktop image (Default).
  * GDI+                Use GDI+ method to capture the desktop image.
  * D3D9                Use DirectX9 method to capture the desktop image.
  * D3D11               Use DirectX11 method to capture the desktop image.
                        Only for Windows 8 and higher. On Windows 7, it's available only with Aero themes.
  * RDP                 Use Remote Desktop Mirror Driver method to capture the desktop image (Windows 7 only)
And DEVICE_NAME must be one valid value returned by the HealthCheck method

All these parameters are optional
Provided nWidth and nHeight values can be modified in forder to keep aspect ratio, fitting to the best values.

Video-stream mode

http://<server-address>:<server-port>/getVideo
  
This request can include aditional parameters:
  * width=<nWidth>      Destination image width. Default value: same as nCX
  * height=<nHeight>    Destination image height. Default value: same as nCY
  * x0=<nX0>            Snapshot window position (horizontal offset). Default value: 0
  * y0=<nY0>            Snapshot window position (vertical offset). Default value: 0
  * cx=<nCX>            Snapshot window width. Default value: Original screen width resolution
  * cy=<nCY>            Snapshot window height. Default value: Original screen height resolution
  * fps=<nFPS>          Aprox. frame rate (in frames per second). Default value: 25
  * cap=<CAPTURER>      Capturer method to be used
  * dev=<DEVICE_NAME>   Device name to be used for screen capturing

Where CAPTURER can be one of these methods:
  * GDI                 Use GDI method to capture the desktop image (Default).
  * GDI+                Use GDI+ method to capture the desktop image.
  * D3D9                Use DirectX9 method to capture the desktop image.
  * D3D11               Use DirectX11 method to capture the desktop image.
                        Only for Windows 8 and higher. On Windows 7, it's available only with Aero themes.
  * RDP                 Use Remote Desktop Mirror Driver method to capture the desktop image (Windows 7 only)
And DEVICE_NAME must be one valid value returned by the HealthCheck method

All these parameters are optional
Provided nWidth and nHeight values can be modified in forder to keep aspect ratio, fitting to the best values.

This stream can be easily embeded in a HTML page using <embed> tag or <img> tag, i.e.:

<embed src="http://<server-address>:<server-port>/getVideo" />
<img src="http://<server-address>:<server-port>/getVideo" />

Examples

  http://127.0.0.1:8080/getImage?width=640&x0=100&y0=100&cx=400&cy=400
  http://127.0.0.1:8080/getVideo?width=640&fps=10&cap=D3D11&dev=%5C%5C.%5CDISPLAY1

screencaptureserver's People

Contributors

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