Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ramonus/flask-video-stream
Simple webcam video streaming python3 script using Flask.
https://github.com/ramonus/flask-video-stream
camera easy flask iot opencv python python3 simple streaming video videostream videostreaming webcam webserver
Last synced: 3 months ago
JSON representation
Simple webcam video streaming python3 script using Flask.
- Host: GitHub
- URL: https://github.com/ramonus/flask-video-stream
- Owner: ramonus
- License: mit
- Created: 2019-05-09T17:04:52.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-02-15T13:33:28.000Z (over 3 years ago)
- Last Synced: 2024-07-27T11:43:05.023Z (4 months ago)
- Topics: camera, easy, flask, iot, opencv, python, python3, simple, streaming, video, videostream, videostreaming, webcam, webserver
- Language: Python
- Size: 58.6 KB
- Stars: 68
- Watchers: 4
- Forks: 30
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Flask-opencv webcam streaming server #
This is a simple python3 script that serves a tiny Flask video webserver that allows to take photos or see real time video streaming of a connected camera/webcam controlled with opencv.## Requirements ##
In order to execute the script you need to install opencv3 -> `import cv2` and some python modules.Move to the project folder and try:
### Try #1: ###
```
pip install -r requirements.txt
```### Try #2: ###
```
pip install flask opencv-python
```
If it gets any error, probably with `opencv-python` try to install them manually.## Running ##
To start the service `cd` to project folder and type `python server.py` or `python3 server.py`*It only runs on python3*
Once done navigate to the ip of the server and access the port `5000`.
http://localhost:5000
## Configuration ##
### Change running port ###
The project is default configured to run at port 5000. To change the running port you must specify the argument `-p, --port [PORT]`.*Example:*
```python3 server.py -p 3000 ``` Runs on port 3000
### Change camera source ###
To change the camera source of opencv you can go to the beginning of file `server.py` and add a `video_source=1` it can be 0,1,2... as many video inputs the device has in the declaration of object `Camera`. Or you can change the default video source on `camera.py` `Camera` class `__init__` method.