Simulates pan-tilt-zoom behavior using static camera input and OpenCV. Designed for low-cost, high-function AV setups in church/live environments.
Professional PTZ gear is expensive. This project creates a software simulation of PTZ motion, allowing one static cam to behave dynamically — through two control modes: auto (face tracking) and manual (mouse).
- Runs YOLO object detection (face-based)
- Zooms into detected face zone
- Outputs two feeds: preview (with stats), NDI (clean overlay-free)
- Manual camera simulation
- Mouse pointer acts as camera target
- Smooth zoom/pan via OpenCV
- Live preview + clean NDI feed
- Input source fed via OpenCV or NDI
- Real-time processing depending on mode
- Feed rendered in:
- Preview (stats/debug window)
- NDI output (clean full-resolution)
- 🧠 CPU usage spikes on YOLO (no GPU)
- Plan: downscale input to 360p, upscale output to 1080p
- Merge both systems for toggle between Auto & Manual modes
Download Python 3.8 or later from:
https://www.python.org/downloads/
git clone https://github.com/Newkoncept/ptz-control.git
cd ptz-control
Or download the ZIP and extract it.
python -m venv venv
# Windows
venv\Scripts\activate
# macOS/Linux
source venv/bin/activate
pip install -r requirements.txt
Make sure to install the NDI runtime for network video output support.
python ptz_tracker.py
ptz-control/
├── ptz_tracker.py # Face-tracking PTZ controller (auto mode)
├── requirements.txt
└── README.md
| Branch Name | Purpose |
|---|---|
main |
Stable, production-ready builds |
dev_face_tracker |
Active development of face tracking |
archive_face_tracker |
Chronological evolution (s1 → s23) |
archive_mouse_tracker |
Chronological evolution (m1 - m4) |
dev_mouse_tracker |
(Planned) manual mode development |
This project began with a series of iterations (s1.py to s23.py) developed locally over months. These are preserved in the archive_face_tracker branch for documentation and reference. The current face tracker (ptz_tracker.py) is built from the final stable iteration.
Minimum required packages:
opencv-python
ultralytics
ndi-python
torch
torchvision