https://github.com/irreq/opencv-webrtc-streamer
Stream OpenCV frames to a web interface and control the OpenCV program
https://github.com/irreq/opencv-webrtc-streamer
cpp html opencv streaming webrtc
Last synced: about 2 months ago
JSON representation
Stream OpenCV frames to a web interface and control the OpenCV program
- Host: GitHub
- URL: https://github.com/irreq/opencv-webrtc-streamer
- Owner: Irreq
- License: mit
- Created: 2025-08-30T14:56:13.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-08-30T15:15:33.000Z (10 months ago)
- Last Synced: 2025-08-30T16:28:11.048Z (10 months ago)
- Topics: cpp, html, opencv, streaming, webrtc
- Language: C++
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenCV WebRTC Streamer
This project demonstrates how to stream an OpenCV video feed through WebRTC into a web browser.
It also includes a minimal HTTP server that serves the web app (`static/index.html`) and accepts control commands.
Useful for developing or monitoring OpenCV programs on headless devices (e.g. robots, embedded systems).
---
## Prerequisites
- C++17 compiler
- [CMake ≥ 3.16](https://cmake.org/)
- [OpenCV](https://opencv.org/)
- [GStreamer 1.0](https://gstreamer.freedesktop.org/) with plugins
- [nlohmann/json](https://github.com/nlohmann/json)
- [libdatachannel](https://github.com/paullouisageneau/libdatachannel)
- [cpp-httplib](https://github.com/yhirose/cpp-httplib)
Clone repository and submodules:
```bash
git clone https://github.com/Irreq/OpenCV-WebRTC-Streamer.git
cd OpenCV-WebRTC-Streamer
git submodule update --init --recursive
```
## Building
```bash
mkdir -p build
cd build
cmake ..
make -j$(nproc)
```
## Usage
```bash
./main --device /dev/video0
```
Then go to the web interface [http://127.0.0.1:9000](http://127.0.0.1:9000)
## Options
See:
```bash
./main -h
```