This project is used as basic template for CV project with separate capture and processing microservices.
Now it has descent FPS without post-processing frame (resize, etc.)
Just git clone https://github.com/Drakrig/opencv-fastapi-video-broadcast.git
and then cd opencv-fastapi-video-broadcast
If you want to test it you have to change couple things in docker compose file.
Optional
Create network fastapi
with command docker network create --subnet=10.10.10.0/24 fastapi
- In
streamer
part changenetwork
to you desired (default or created). May skip if using you did optional step above. - In
capture
part change -"~/Videos/:/mnt/"
to format"{path/to/folder/with/test/video}:/mnt/"
. Be sure that video namedtest.mp4
or change it incapture/main.py
to your desired. - If you skip optional step, in
networks
section change network settings according to yours
Simply docker compose up
or docker-compose up
. It should work out the box. In console click on http://0.0.0.0:80
and watch your video. It might take couple seconds to load it.
I take code for streamer.py
and index.html
from this great guy https://github.com/codectl/remote-opencv-streaming-live-video/tree/master
. Also take some parts from server.py
and streamer.py
Code and documentation released under the MIT License