Video Frame Streamer
6 min
Overview
Video Frame Streamer reads a video file or stream with OpenCV, converts the frames to Base64 and publishes them to the NATS broker on Litmus Edge.

Install
Prerequisites
- Litmus Edge 4.4.x (tested on 4.4.x).
- Access to the Litmus Edge Applications -> Images and Applications -> Containers features.
- The Litmus Edge NATS broker reachable at nats://10.30.50.1:4222 from the container. This is the default Edge gateway address and no NATS token is needed.
- Architecture: amd64 only. arm64 is not supported.
- The image file nats-video-streaming-1-1-1.tar.gz, downloaded from Litmus Central.
Steps
- Log in to your Litmus Edge and navigate to Applications -> Images.
- Click Upload Image and upload nats-video-streaming-1-1-1.tar.gz. The image loads as nats-video-streaming:latest.
- Navigate to Applications -> Containers and enter the following command:
docker run -e NATS_FPS=10 -e VIDEO_URL=<location of video> -e DATA_IN_BYTES_OR_ARRAY=array -e PUB_TOPIC=images nats-video-streaming:latest- Replace <location of video> with an ftp-data, HTTP or RTSP location. For testing you can use https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/360/Big_Buck_Bunny_360_10s_1MB.mp4.
- Enter every value without quotes. The Containers page passes quotes through as part of the value, and the container then rejects the topic.
Values
Variable | Required | Default | Example | Description |
|---|---|---|---|---|
VIDEO_URL | Yes | none | rtsp://... | Video file or stream to read: ftp-data, HTTP or RTSP location. |
NATS_FPS | No | 1 | 10 | Frames per second published to NATS. Anything above 15 can affect performance heavily, depending on hardware. |
DATA_IN_BYTES_OR_ARRAY | No | bytes | array | Format of the published output: bytes or array. |
PUB_TOPIC | No | images | images | NATS topic to publish the processed output to. The raw Base64 image without timestamp is also published on <PUB_TOPIC>.rawImage. |
Check
- On Applications -> Containers, the container shows Running.
- In Flows, add a DataHub Subscribe node on the topic set in PUB_TOPIC (for example images) and confirm messages arrive.
- Optionally, install node-red-contrib-image-output in Flows to view the frames as a live image. Subscribe to PUB_TOPIC with .rawImage appended, for example images.rawImage (this library decodes Base64 to a raw image).
Remove
- On Applications -> Containers, stop and delete the container.
- On Applications -> Images, delete the nats-video-streaming:latest image.