Flask-OpenCV-Streamer
A Python package for easily streaming OpenCV footage, even with authentication
Installation
Install via PyPi using Pip / PipEnv:
pip install flask_opencv_streamer
Usage
Usage is quite straight forward. After importing, you can create as many streamer objects as you wish.
Example Code:
Without authentication (no login required to view page)
from flask_opencv_streamer.streamer import Streamer
import cv2
port = 3030
require_login = False
streamer = Streamer(port, require_login)
# Open video device 0
video_capture = cv2.VideoCapture(0)
while True:
_, frame = video_capture.read()
streamer.update_frame(frame)
if not streamer.is_streaming:
streamer.start_streaming()
cv2.waitKey(30)
With authentication (A password will be generated for you, expiring every 24 hrs)
from flask_opencv_streamer.streamer import Streamer
import cv2
port = 3030
require_login = True
login_file = "logins.txt"
login_key = "loginkey.txt
streamer = Streamer(port, require_login, login_file=login_file, login_key=login_key)
# Open video device 0
video_capture = cv2.VideoCapture(0)
while True:
_, frame = video_capture.read()
streamer.update_frame(frame)
if not streamer.is_streaming:
streamer.start_streaming()
cv2.waitKey(30)
If there is no logins file or key found at the path given, it will create one for you. Logins will be stored in a .txt file logins.txt but will be encrypted. Therefore, unless someone has the key (in this example, loginkey.txt) the logins.txt file will be able to show logins or passwords. It is very unsafe to keep the login key somewhere publicly accessible; it's suggested you hide it well and do not upload it anywhere.
Adding or removing your own logins
In your root project directory, you can include a templates folder which can be used for password change templates. Your file names must be:
form.html: Contains the HTML form for the password change.pass.html: Contains the HTML for a pass eventfail.html: Contains the HTML for a fail event
Samples are included here in this repository
Metadata
Release files for flask-opencv-streamer 1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| flask_opencv_streamer-1.4.tar.gz | 5.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| flask_opencv_streamer-1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.5 kB
Release files / flask_opencv_streamer-1.4.tar.gz
| Download URL | flask_opencv_streamer-1.4.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3df8eb0b72946d6fd3c8cadfcd9631eecb6845d15d66e0e23b1ce9c83412ab5b
|
|
BLAKE2b-256 checksum How to use checksums |
05828703255c1f0e0d43efb7576cd544b04cb8946bc7f62eded9a3b115ae1743
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
|
Release files / flask_opencv_streamer-1.4-py3-none-any.whl
| Download URL | flask_opencv_streamer-1.4-py3-none-any.whl |
|---|---|
| Size | 18.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6f7e763fd9f6a718c38b735b053fc5b57e6e8a272aff597ad229fe92dd5077fa
|
|
BLAKE2b-256 checksum How to use checksums |
52e5a9b8b2cab2132ba41438ab81406aef4185527e7958a8b007ed6778b9b9e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
|
Security for flask-opencv-streamer 1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.