Skip to content

dkprog/ndi-loop-camera-hx

Repository files navigation

ndi-loop-camera-hx

Container service that plays video files on a continuous loop and outputs an NDI HX (compressed H.264/H.265) stream using the NDI Advanced SDK.

example

What it does

  • Serves as a lightweight C++ + GStreamer application that I use to simulate extra NDI HX cameras during development and testing
  • Runs as a container
  • Opens a video file (.mp4, .mov) and loops it indefinitely
  • Sends compressed video (H.264/H.265) directly over NDI using the Advanced SDK — no transcoding
  • Audio is decoded to raw PCM and sent alongside the video stream

Pipeline with video and audio:

pipeline with audio

Pipeline with video only:

pipeline video only

Quick start

Install dependencies

To build the container, request the NDI Advanced SDK and place the Linux version at NDI_SDK_DIR="NDI Advanced SDK for Linux" in the project root.

Set the SDK version via the .env file:

NDI_SDK_VERSION=6.0.0

Provide your Advanced SDK license in ndi-config.v1.json.

(NDI does not allow redistributing the SDK inside the container, so this step must be done manually.)

Select the video file

Place a video file in video/ and set:

VIDEO_FILENAME=/video/video.mp4

This file will loop continuously.

Define the NDI source name

Set the NDI source name using:

NDI_NAME=foobar

The final advertised NDI source will follow this pattern:

<HOSTNAME> (NDI_NAME)

For example, if your machine is named DEVBOX and you set NDI_NAME=foobar, the NDI stream will appear on the network as:

DEVBOX (foobar)

Build the container

docker compose build ndi-loop-camera-hx

Run the container

docker compose up -d ndi-loop-camera-hx

You can preview the stream using NDI Studio Monitor (Windows).

Run tests

docker compose run test

About

Container that loops a video file and outputs an NDI|HX stream.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors