This project provides a simple multi-threaded web server implemented in Python for streaming video from multiple cameras connected to the server. The video streams are transmitted via WebSocket, and the server also includes face detection functionality using the OpenCV library.
https://gist.github.com/arvind-iyer/90cd941d0885f422bdf90905d86f9e04
- WebSocket Transmission: Real-time video streaming to clients using WebSocket.
- Face Detection: Uses OpenCV for detecting faces in the video streams.
- Multiple Camera Support: Can handle multiple camera inputs simultaneously.
- Python 3.x
- OpenCV
- WebSocket
-
Clone the repository:
git clone https://github.com/ilushinvanya/video-surveillance.git
cd video-surveillance
-
Install the required dependencies:
pip install -r requirements.txt
-
Connect your cameras to the server.
-
Run the server
python ./server.py
- Will run on localhost on port 8765, default
ws://127.0.0.1:8765/media/0
- 127.0.0.1 - server ip address
- 8765 - port specified when starting the server
- media - path
- 0 - index of the cameras that the server recognized; if there are several cameras, they will be available with the values 1,2,3...
- Will run on localhost on port 8765, default
-
Open the
client.html
file, the default server address will be written in the input field to view the video streams. -
Open the
index.html
file, for multi-camera viewing mode, you can add several copies of the client.html file.
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.