You are here Home RTMP Video Streaming

RTMP Video Streaming

Live video is captured using a Sony IMX477 10 Mega pixel solid state sensor fitted with a 16mm telephoto lens. The sensor is programmed using the open source libcamera-vid application. The output from the sensor is fed into a hardware bcm2835 codec which produces encoded H264 video streams.

The H264 video streams are then further processed using the libav software library to produce Flash (flv) formatted frames which are then streamed over RTMP (real time media protocol) to the client web server.

The client server operating system is Debian 11 (Bullseye) and hosts an instance of an nginx web server. The web server has the nginx RTMP module enabled which is operational whenever the web server is enabled.

The incoming video stream is processed by the RTMP application and passed to an HLS (HTTP Live Stream) application where the video stream is saved as two-second HLS file segments. A play length of ten seconds ensures a good level of latency so as not to fall too far behind the real time event.

Playback of the HLS segments relies on HTML5 and Java script enabled browsers and has been tested with Google Chrome, Firefox, Safari and MS Edge. There is an upper limit of 1000 concurrent users set to ensure acceptable performance.

For the technically minded the implemented configuration is:

The Camera Host Server

RPi 4B v1.5 four cores 4GB RAM
O/S Debian 11 Bullseye
bcm2835 hardware codec producing H264 encoded streams
ffmpeg v4.3.6 application (provides the libav flv encoding library)
Sony IMX477 sensor and 16mm lens
The video stream is output as flv formatted frames at 60 fps over RTMP to the nginx web server using the following command line:
"libcamera-vid --nopreview -t 0 --level 4.2 --framerate 60 --codec libav --libav-format flv --denoise cdn_off --inline --output rtmp://"

The Web Server

RPi 4B v1.2 four cores 4GB RAM
O/S Debian 11 Bullseye
Nginx 1.18.0 with the RTMP module enabled
ffmpeg v4.3.6 application, provides the codec for decoding the video streams
video.js Java script

The stream can be viewed by any HTML5 browser that has Java script enabled.

The video stream is typically available on weekdays, 09:00 to 16:30 (in season) when South Wilts have a cricket match scheduled. At other times the stream is available on an ad hoc basis, usually to conduct system testing. When live, the stream can be viewed here or scan the QR code below.

A catalogue of recorded streams can be viewed here

Back to the top