High-performance bridge connecting Python OpenCV to React using Binary WebSockets
Project description
cv-ws-streamer
A high-performance Python library for streaming frames (OpenCV/NumPy) to a React client via Binary WebSockets.
Features
- 🚀 Binary Protocol: Low overhead MJPEG streaming.
- Two-way Communication: Handle clicks and events from the frontend.
- FastAPI Integration: Easy to drop into existing FastAPI apps.
Installation
pip install cv-ws-streamer
Usage
from fastapi import FastAPI, WebSocket
from cv_ws_streamer.core import Streamer
import cv2
app = FastAPI()
streamer = Streamer(jpeg_quality=70)
@app.websocket("/ws")
async def websocket_endpoint(websocket: WebSocket):
await streamer.connect(websocket)
# In your video loop:
# await streamer.send_frame(frame)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cv_ws_streamer-0.1.0.tar.gz
(2.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cv_ws_streamer-0.1.0.tar.gz.
File metadata
- Download URL: cv_ws_streamer-0.1.0.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06600a2b2784f9331ad76ebec6ab48c06b08f6b67c6404f167c67a053a77bb77
|
|
| MD5 |
51cb352b0824329c8641a13e5347d5bd
|
|
| BLAKE2b-256 |
8833ebd1dc7ade939c5ecd7339f89485ece750c1c1dfbf1fec10f9884c313649
|
File details
Details for the file cv_ws_streamer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cv_ws_streamer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
678b8917b36cb6465dfce530f215c492edbb07eecd86712719b5fbcf17d9c4a4
|
|
| MD5 |
5475d445ff0201cdae046b770dc9ed54
|
|
| BLAKE2b-256 |
7f634726cb78952b8d3fe8e5b4251cfc07731b05911455410cda42652f76023e
|