https://github.com/akmamun/live-stream-face-detection
Live Streaming and Face Detection with Flask in Browser
https://github.com/akmamun/live-stream-face-detection
camera-feed camera-stream face-detection flask ip-camera live-streaming open-cv python rtsp rtsp-stream stream-api streaming video-streaming web-frame webcam-streaming
Last synced: about 1 year ago
JSON representation
Live Streaming and Face Detection with Flask in Browser
- Host: GitHub
- URL: https://github.com/akmamun/live-stream-face-detection
- Owner: akmamun
- License: mit
- Created: 2018-10-22T17:25:27.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-08-30T23:52:32.000Z (almost 2 years ago)
- Last Synced: 2025-02-26T21:11:44.040Z (over 1 year ago)
- Topics: camera-feed, camera-stream, face-detection, flask, ip-camera, live-streaming, open-cv, python, rtsp, rtsp-stream, stream-api, streaming, video-streaming, web-frame, webcam-streaming
- Language: Python
- Homepage:
- Size: 112 KB
- Stars: 82
- Watchers: 6
- Forks: 36
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Live Streaming and Face Detection with Flask
```python
pip install -r requirements.txt
```
### Run Server
```python
python app.py
```
### Use Built-in Webcam of Laptop
- Put Zero (O) in cv2.VideoCapture(0)
```python
cv2.VideoCapture(0)
```
#### Use Ip Camera/CCTV/RTSP Link
```python
cv2.VideoCapture('rtsp://username:password@camera_ip_address:554/user=username_password='password'_channel=channel_number_stream=0.sdp')
```
#### Example RTSP Link
```python
cv2.VideoCapture('rtsp://mamun:123456@101.134.16.117:554/user=mamun_password=123456_channel=0_stream=0.sdp')
```
#### Change Channel Number to Change the Camera
```python
cv2.VideoCapture('rtsp://mamun:123456@101.134.16.117:554/user=mamun_password=123456_channel=1_stream=0.sdp')
```
#### Display the resulting frame in browser
```python
cv2.imencode('.jpg', frame)[1].tobytes()
```
#### Display the resulting frame in window
#### Instead of return use this in [camera.py](/camera.py)
```python
cv2.imshow('frame', frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
```
### Learn More
Learn More about Streaming with flask
- https://blog.miguelgrinberg.com/post/video-streaming-with-flask