Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/akmamun/camera-live-streaming
Camera Live Streaming with Flask and Open-CV
https://github.com/akmamun/camera-live-streaming
cctv-cameras flask live-streaming opencv-python python rtsp rtsp-stream streaming video-stream
Last synced: about 6 hours ago
JSON representation
Camera Live Streaming with Flask and Open-CV
- Host: GitHub
- URL: https://github.com/akmamun/camera-live-streaming
- Owner: akmamun
- Created: 2019-01-28T20:21:37.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-08-30T23:52:31.000Z (4 months ago)
- Last Synced: 2024-12-16T02:05:44.720Z (7 days ago)
- Topics: cctv-cameras, flask, live-streaming, opencv-python, python, rtsp, rtsp-stream, streaming, video-stream
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 78
- Watchers: 4
- Forks: 42
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Live Streaming with Flask and Open-CV
```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:[email protected]:554/user=mamun_password=123456_channel=0_stream=0.sdp')
```
#### Change Channel Number to Change the Camera
```python
cv2.VideoCapture('rtsp://mamun:[email protected]:554/user=mamun_password=123456_channel=1_stream=0.sdp')
```
#### Display the resulting frame in browser
```python
cv2.imencode('.jpg', frame)[1].tobytes()
```
## Or this one```python
net , buffer = cv2.imencode('.jpg', frame)
buffer.tobytes()
```## Credit
Learn More about Streaming with flask
- https://blog.miguelgrinberg.com/post/video-streaming-with-flask