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.
- 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
- Clone or download this repository
- Install dependencies:
pip install -r requirements.txt
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- 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
python main.pyThe server will start on HTTPS and generate a self-signed certificate automatically if one doesn't exist.
Open your browser and navigate to:
- Local: https://localhost:5000
- Network: https://YOUR_IP_ADDRESS:5000
Note: You'll need to accept the self-signed certificate warning in your browser.
- 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
GET /- Web interfaceGET /screenshot/full- Capture full screenGET /screenshot/active- Capture active windowGET /stream- MJPEG live streamGET /stream/status- Stream status informationPOST /stream/start- Start global streamingPOST /stream/stop- Stop global streamingPOST /shutdown?token=TOKEN- Graceful server shutdown
- Python 3.7+
- Windows, macOS, or Linux
- For Active Window capture:
pygetwindowpackage (included in requirements)
- The server generates self-signed certificates for HTTPS
- Use the shutdown token to secure the
/shutdownendpoint - Consider running behind a reverse proxy for production use
- Firewall rules may be needed to allow external access
- Permission Errors: Run with appropriate permissions for screen capture
- Port Already in Use: Change the port in
config.ini - Active Window Not Working: Install
pygetwindowpackage - SSL Certificate Issues: Delete
cert.pemandkey.pemto regenerate
- Lower FPS for better performance with multiple clients
- Use JPEG format for smaller file sizes
- Adjust JPEG quality based on needs vs file size
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)
This project is provided as-is for educational and personal use.
Feel free to submit issues, fork the repository, and create pull requests for any improvements.