From 28d2cbc85eabeedf5976d8a3228e51d81d783768 Mon Sep 17 00:00:00 2001 From: Michel Promonet Date: Sat, 14 Jan 2023 19:10:34 +0100 Subject: [PATCH 1/3] Update README.md --- README.md | 191 +++++++++++++++++++++++++----------------------------- 1 file changed, 87 insertions(+), 104 deletions(-) diff --git a/README.md b/README.md index 49051c3d..bb340ada 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -
- A picture of a Nano PI NEO Air, a small device with a camera. The camera is pointing towards the viewer. # WebRTC-Streamer +[![NanoPi](images/nanopi.jpg)](http://wiki.friendlyarm.com/wiki/index.php/NanoPi_NEO_Air) + [![CircleCI](https://img.shields.io/circleci/build/github/mpromonet/webrtc-streamer?label=circleci&logo=circleci)](https://circleci.com/gh/mpromonet/webrtc-streamer) [![CirusCI](https://img.shields.io/cirrus/github/mpromonet/webrtc-streamer?label=cirrusci&logo=cirrusci)](https://cirrus-ci.com/github/mpromonet/webrtc-streamer) [![Snap Status](https://snapcraft.io//webrtc-streamer/badge.svg)](https://snapcraft.io/webrtc-streamer) @@ -17,26 +17,13 @@ [![Demo](https://img.shields.io/badge/azure-demo-blue)](https://webrtcstreamer.agreeabletree-365b9a90.canadacentral.azurecontainerapps.io/) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/mpromonet/webrtc-streamer) -**An experimental, straight-forward abstraction over WebRTC to stream various -media sources.** - -
+experimentation to stream WebRTC media sources like capture devices, screen capture, mkv files and RTSP sources using simple signaling. -## Installation +## Artefacts -If you don't want to [compile it yourself](#manual-build), you can download the -artifacts off of [CircleCI](https://circleci.com/gh/mpromonet/webrtc-streamer), -[CirrusCI](https://cirrus-ci.com/github/mpromonet/webrtc-streamer), or -[GitHub CI](https://github.com/mpromonet/webrtc-streamer/actions), for the -following architectures: +* packages are available from https://github.com/mpromonet/webrtc-streamer/releases/latest +* container image are available from https://hub.docker.com/r/mpromonet/webrtc-streamer -- x86_64 on Ubuntu Bionic -- armv7 crosscompiled (this build is running on Raspberry Pi2 and NanoPi NEO) -- armv6+vfp crosscompiled (this build is running on Raspberry PiB and should run - on a Raspberry Zero) -- arm64 crosscompiled -- Windows x64 build with clang -- MacOS ## Usage @@ -80,23 +67,6 @@ allows forwarding H264 frames from V4L2 device or RTSP stream to WebRTC stream. It uses less CPU, but has less features (resize, codec, and bandwidth are disabled). -## HTTP API - -It embeds a HTTP server that implements an API and serves a simple HTML page -that uses the endpoints through AJAX calls. - -WebRTC-streamer implements -[WebRTC signaling](https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Signaling_and_video_calling) -through HTTP requests: - -- `/api/call` - send offer and get answer -- `/api/hangup` - close a call - -- `/api/addIceCandidate` - add a candidate -- `/api/getIceCandidate` - get the list of candidates - -The list of HTTP API endpoints is available by GETting `/api/help`. - Options for the WebRTC stream name: - an alias defined using `-n` argument then the corresponding `-u` argument will @@ -113,50 +83,7 @@ Options for the WebRTC stream name: Windows) - a capture device name -## Manual Build - -### Dependencies - -This package depends on the following packages: - -- [WebRTC Native Code Package](http://www.webrtc.org) for WebRTC -- [civetweb HTTP server](https://github.com/civetweb/civetweb) for HTTP server -- [live555](http://www.live555.com/liveMedia) for RTSP/MKV source - -The following steps are required to build the project, and will install the -dependencies above: - -1. Install the Chromium depot tools (for WebRTC - contains a variety of tools - that helps external WebRTC development). - - ```sh - pushd .. - git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git - export PATH=$PATH:`realpath depot_tools` - popd - ``` -2. Download WebRTC - - ```sh - mkdir ../webrtc - pushd ../webrtc - fetch --no-history webrtc - popd - ``` - -3. Build WebRTC Streamer - - ```sh - cmake . && make - ``` - -It is possible to specify cmake parameters `WEBRTCROOT` & -`WEBRTCDESKTOPCAPTURE`: - -- `$WEBRTCROOT/src` should contains source (default is $(pwd)/../webrtc) -- `WEBRTCDESKTOPCAPTURE` enabling desktop capture if available (default is ON) - -## Examples +#### Examples ```sh ./webrtc-streamer rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov @@ -173,14 +100,43 @@ For instance: - [webrtcstreamer.html?rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov](https://webrtcstreamer.agreeabletree-365b9a90.canadacentral.azurecontainerapps.io/webrtcstreamer.html?rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov) - [webrtcstreamer.html?Bunny](https://webrtcstreamer.agreeabletree-365b9a90.canadacentral.azurecontainerapps.io/webrtcstreamer.html?Bunny) ---- - An example displaying grid of WebRTC Streams is available using option `layout=x` [![Screenshot](images/layout2x4.png)](https://webrtcstreamer.agreeabletree-365b9a90.canadacentral.azurecontainerapps.io/?layout=2x4) [Live Demo (?layout=2x4)](https://webrtcstreamer.agreeabletree-365b9a90.canadacentral.azurecontainerapps.io/?layout=2x4) +## Using docker image + +You can start the application using the docker image: + +```sh +docker run -p 8000:8000 -it mpromonet/webrtc-streamer +``` + +You can expose V4L2 devices from your host using: + +```sh +docker run --device=/dev/video0 -p 8000:8000 -it mpromonet/webrtc-streamer +``` + +The container entry point is the webrtc-streamer application, then you can: + +- view all commands + ```sh + docker run -p 8000:8000 -it mpromonet/webrtc-streamer --help + ``` +- run the container registering a RTSP url: + + ```sh + docker run -p 8000:8000 -it mpromonet/webrtc-streamer -n raspicam -u rtsp://pi2.local:8554/unicast + ``` +- run the container giving config.json file: + + ```sh + docker run -p 8000:8000 -v $PWD/config.json:/app/config.json mpromonet/webrtc-streamer + ``` + ## Using embedded STUN/TURN server behind a NAT It is possible to start an embeded [STUN](https://en.wikipedia.org/wiki/STUN) @@ -357,33 +313,60 @@ A short sample to publish WebRTC streams to a Jitsi Video Room could be: [Live Demo](https://webrtcstreamer.agreeabletree-365b9a90.canadacentral.azurecontainerapps.io/xmppvideoroom.html) -## Docker Image +## Build -You can start the application using the docker image: +### Dependencies -```sh -docker run -p 8000:8000 -it mpromonet/webrtc-streamer -``` +This package depends on the following packages: -You can expose V4L2 devices from your host using: +- [WebRTC Native Code Package](http://www.webrtc.org) for WebRTC +- [civetweb HTTP server](https://github.com/civetweb/civetweb) for HTTP server +- [live555](http://www.live555.com/liveMedia) for RTSP/MKV source -```sh -docker run --device=/dev/video0 -p 8000:8000 -it mpromonet/webrtc-streamer -``` +The following steps are required to build the project, and will install the +dependencies above: -The container entry point is the webrtc-streamer application, then you can: +1. Install the Chromium depot tools -- view all commands - ```sh - docker run -p 8000:8000 -it mpromonet/webrtc-streamer --help - ``` -- run the container registering a RTSP url: + ```sh + pushd .. + git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git + export PATH=$PATH:`realpath depot_tools` + popd + ``` +2. Download WebRTC - ```sh - docker run -p 8000:8000 -it mpromonet/webrtc-streamer -n raspicam -u rtsp://pi2.local:8554/unicast - ``` -- run the container giving config.json file: + ```sh + mkdir ../webrtc + pushd ../webrtc + fetch --no-history webrtc + popd + ``` - ```sh - docker run -p 8000:8000 -v $PWD/config.json:/app/config.json mpromonet/webrtc-streamer - ``` +3. Build WebRTC Streamer + + ```sh + cmake . && make + ``` + +It is possible to specify cmake parameters `WEBRTCROOT` & +`WEBRTCDESKTOPCAPTURE`: + +- `$WEBRTCROOT/src` should contains source (default is $(pwd)/../webrtc) +- `WEBRTCDESKTOPCAPTURE` enabling desktop capture if available (default is ON) + + +## Pipelines + +There is pipelines on [CircleCI](https://circleci.com/gh/mpromonet/webrtc-streamer), +[CirrusCI](https://cirrus-ci.com/github/mpromonet/webrtc-streamer), or +[GitHub CI](https://github.com/mpromonet/webrtc-streamer/actions), for the +following architectures: + +- x86_64 on Ubuntu +- armv7 crosscompiled (this build is running on Raspberry Pi2 and NanoPi NEO) +- armv6+vfp crosscompiled (this build is running on Raspberry PiB and should run + on a Raspberry Zero) +- arm64 crosscompiled +- Windows x64 build with clang +- MacOS From a3c5a1ed8f22156d3dcf9e14b097813b015c4144 Mon Sep 17 00:00:00 2001 From: Michel Promonet Date: Sat, 14 Jan 2023 19:13:31 +0100 Subject: [PATCH 2/3] Create api.md --- docs/api.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 docs/api.md diff --git a/docs/api.md b/docs/api.md new file mode 100644 index 00000000..bdd1f803 --- /dev/null +++ b/docs/api.md @@ -0,0 +1,11 @@ +# api + +The WebRTC signaling is implemented through HTTP requests: + + - /api/call : send offer and get answer + - /api/hangup : close a call + + - /api/addIceCandidate : add a candidate + - /api/getIceCandidate : get the list of candidates + +The list of HTTP API is available using /api/help. From d433250bd1cff9317a786487f801fa3dcee8c873 Mon Sep 17 00:00:00 2001 From: Michel Promonet Date: Sat, 14 Jan 2023 19:28:01 +0100 Subject: [PATCH 3/3] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bb340ada..98a04e57 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # WebRTC-Streamer -[![NanoPi](images/nanopi.jpg)](http://wiki.friendlyarm.com/wiki/index.php/NanoPi_NEO_Air) +A picture of a Nano PI NEO Air [![CircleCI](https://img.shields.io/circleci/build/github/mpromonet/webrtc-streamer?label=circleci&logo=circleci)](https://circleci.com/gh/mpromonet/webrtc-streamer) [![CirusCI](https://img.shields.io/cirrus/github/mpromonet/webrtc-streamer?label=cirrusci&logo=cirrusci)](https://cirrus-ci.com/github/mpromonet/webrtc-streamer) @@ -17,7 +17,7 @@ [![Demo](https://img.shields.io/badge/azure-demo-blue)](https://webrtcstreamer.agreeabletree-365b9a90.canadacentral.azurecontainerapps.io/) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/mpromonet/webrtc-streamer) -experimentation to stream WebRTC media sources like capture devices, screen capture, mkv files and RTSP sources using simple signaling. +Experimentation to stream WebRTC media sources like capture devices, screen capture, mkv files and RTSP sources using simple signaling. ## Artefacts