A Python-based GUI application that allows users to upload videos, create a library, and stream them as virtual cameras via RTSP. Each virtual camera can stream one or more videos on repeat, simulating real camera behavior for testing and development purposes.
- Upload videos to create a video library
- Create multiple virtual camera instances
- Stream videos via RTSP protocol
- Play videos on continuous repeat
- Support for multiple videos per camera (sequential playback)
- Built-in RTSP stream viewer
- RTSP authentication support
- Simple GUI interface with basic authentication
- Python 3.11 or higher
- GStreamer 1.0+ with RTSP server support
- Linux, Windows, or macOS
pip install.
Linux (Ubuntu/Debian):
sudo apt-get update
sudo apt-get install -y \
python3-pip \
python3-venv \
python3-dev \
pkg-config \
python3-gi \
python3-gi-cairo \
gir1.2-gstreamer-1.0 \
gir1.2-gst-rtsp-server-1.0 \
libcairo2-dev \
libgirepository1.0-dev \
gstreamer1.0-tools \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad \
libgstreamer1.0-dev \
libgstrtspserver-1.0-devmacOS:
brew install gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-rtsp-server python@3.11Windows:
- Download GStreamer runtime from https://gstreamer.freedesktop.org/download/
- Install GStreamer runtime
- Add GStreamer bin directory to PATH
pip install.
Linux (Ubuntu/Debian) - Run this command:
sudo apt-get update && sudo apt-get install -y \
python3-pip \
python3-venv \
python3-dev \
pkg-config \
python3-gi \
python3-gi-cairo \
gir1.2-gstreamer-1.0 \
gir1.2-gst-rtsp-server-1.0 \
libcairo2-dev \
libgirepository1.0-dev \
libgirepository-2.0-dev \
gobject-introspection \
gstreamer1.0-tools \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad \
libgstreamer1.0-dev \
libgstrtspserver-1.0-devImportant Notes:
python3-tkis required for tkinter (GUI framework) - it's a system package, not installable via piplibgirepository-2.0-devis required for PyGObject to findgirepository-2.0via pkg-config
macOS:
brew install pkg-config cairo gobject-introspection gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-rtsp-serverWindows: Install GStreamer runtime from https://gstreamer.freedesktop.org/download/ and ensure it's in PATH.
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install --upgrade pip
pip install -r requirements.txtTroubleshooting: If PyGObject installation fails with "pkg-config not found" or "cairo not found", you need to install the system dependencies from Step 1 first. See INSTALL.md for detailed troubleshooting.
gst-launch-1.0 --versionShould output GStreamer version information.
python src/main.pyOn first run, the application will prompt you to create credentials:
- Username: (choose a username)
- Password: (choose a password)
Credentials are stored in data/credentials.json.
- Click "Upload Video" button
- Select a video file from your computer
- Wait for upload and metadata extraction to complete
- Video appears in library list
Supported Formats: MP4, AVI, MOV, MKV (any format OpenCV can read)
- Click "Create Camera" button
- Enter a name for the camera (e.g., "Front Door")
- Select one or more videos from the library
- (Optional) Enable RTSP authentication:
- Check "Enable Authentication"
- Enter username and password
- Click "Create"
- Camera appears in camera list with status "inactive"
- Select a camera from the list
- Click "Start" button
- Camera status changes to "active"
- RTSP URL is displayed (e.g.,
rtsp://localhost:8554/camera/{id})
- With camera active, click "View Stream" button
- Viewer window opens showing the RTSP stream
- Video plays in loop (or cycles through multiple videos)
- Select active camera
- Click "Stop" button
- Camera status changes to "inactive"
- RTSP stream stops
- Start a virtual camera
- Copy the RTSP URL
- Open VLC Media Player
- Media → Open Network Stream
- Paste RTSP URL
- If authentication enabled, enter username/password
- Click Play
ffplay rtsp://localhost:8554/camera/{camera-id}If authentication enabled:
ffplay rtsp://username:password@localhost:8554/camera/{camera-id}project_root/
├── src/ # Source code
│ ├── models/ # Data models
│ ├── services/ # Business logic
│ └── gui/ # GUI components
├── videos/ # Uploaded video files
├── data/ # Metadata and configuration
│ ├── videos.json
│ ├── cameras.json
│ └── credentials.json
├── venv/ # Virtual environment
├── requirements.txt # Python dependencies
└── README.md
Error: ModuleNotFoundError: No module named 'gi' or GStreamer errors
Solution: Install system GStreamer packages (see Prerequisites)
Error: PortInUseError when starting camera
Solution:
- Stop other cameras using the port
- Or modify camera configuration to use different port
Error: Video uploads but won't stream
Solution:
- Verify video file is not corrupted
- Check video format is supported by OpenCV
- Verify GStreamer plugins are installed
Error: Cannot connect to RTSP stream with credentials
Solution:
- Verify username/password are correct
- Check camera has authentication enabled
- Ensure RTSP client supports authentication
This project follows the KISS (Keep It Simple, Stupid) principle:
- Simple file-based storage (JSON + filesystem)
- Minimal dependencies
- Functional GUI (not polished)
- Single-user desktop application
[Add license information]