Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Remote Desktop Screenshot & Streaming Server

A Flask-based web application that provides remote desktop screenshot capabilities and live MJPEG streaming over HTTPS. Perfect for remote desktop monitoring, screen sharing, or automated screenshot capture.

Features

  • Screenshots: Capture full screen or active window screenshots
  • Live Streaming: Real-time MJPEG video streaming at configurable FPS
  • Web Interface: Modern, responsive web UI with dark/light theme support
  • Clipboard Integration: Copy screenshots/frames directly to clipboard
  • SSL/HTTPS: Built-in self-signed certificate generation
  • Configurable: Customizable via config file
  • Multi-client: Supports multiple simultaneous streaming connections
  • Optimized: Frame caching and efficient streaming to reduce CPU usage

Installation

  1. Clone or download this repository
  2. Install dependencies:
    pip install -r requirements.txt

Configuration

Create a config.ini file in the project directory:

[Server]
Host = 0.0.0.0
Port = 5000

[Screenshot]
SaveDirectory = screenshots
Format = jpeg
JpegQuality = 90

[Stream]
Fps = 8.0

[Shutdown]
Token = your-secure-shutdown-token

Configuration Options

  • Host: Server bind address (default: 0.0.0.0)
  • Port: Server port (default: 5000)
  • SaveDirectory: Directory for saved screenshots (default: screenshots)
  • Format: Image format - jpeg, png, webp (default: jpeg)
  • JpegQuality: JPEG compression quality 1-100 (default: 90)
  • Fps: Streaming frame rate (default: 8.0)
  • Token: Security token for shutdown endpoint

Usage

Starting the Server

python main.py

The server will start on HTTPS and generate a self-signed certificate automatically if one doesn't exist.

Accessing the Interface

Open your browser and navigate to:

Note: You'll need to accept the self-signed certificate warning in your browser.

Web Interface Controls

  • Fullscreen: Capture entire screen
  • Active Window: Capture currently active window
  • Live Stream: Start/stop real-time streaming
  • Copy Image: Copy current image/frame to clipboard
  • Theme Toggle: Switch between light/dark themes

API Endpoints

  • GET / - Web interface
  • GET /screenshot/full - Capture full screen
  • GET /screenshot/active - Capture active window
  • GET /stream - MJPEG live stream
  • GET /stream/status - Stream status information
  • POST /stream/start - Start global streaming
  • POST /stream/stop - Stop global streaming
  • POST /shutdown?token=TOKEN - Graceful server shutdown

Requirements

  • Python 3.7+
  • Windows, macOS, or Linux
  • For Active Window capture: pygetwindow package (included in requirements)

Security Considerations

  • The server generates self-signed certificates for HTTPS
  • Use the shutdown token to secure the /shutdown endpoint
  • Consider running behind a reverse proxy for production use
  • Firewall rules may be needed to allow external access

Troubleshooting

Common Issues

  1. Permission Errors: Run with appropriate permissions for screen capture
  2. Port Already in Use: Change the port in config.ini
  3. Active Window Not Working: Install pygetwindow package
  4. SSL Certificate Issues: Delete cert.pem and key.pem to regenerate

Performance Tips

  • Lower FPS for better performance with multiple clients
  • Use JPEG format for smaller file sizes
  • Adjust JPEG quality based on needs vs file size

File Structure

project/
├── main.py              # Main application
├── config.ini           # Configuration file
├── requirements.txt     # Python dependencies
├── README.md           # This file
├── cert.pem            # SSL certificate (auto-generated)
├── key.pem             # SSL private key (auto-generated)
├── screenshots/        # Screenshot storage directory
└── logs/               # Application logs (if configured)

License

This project is provided as-is for educational and personal use.

Contributing

Feel free to submit issues, fork the repository, and create pull requests for any improvements.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages