Skip to main content

Run your first pipeline

This page starts with one command and no files, then moves to a configuration file of your own. Both steps run on the CPU and need no camera, GPU or CDN account, only Docker and a player that opens SRT (ffplay from FFmpeg, or VLC).

Set PACKAGER_IMAGE to the Packager image and release tag that Vindral supplies with your Bridge access. Use an image that includes x264, since this page encodes on the CPU. The value below is a placeholder; replace it before running the commands.

bash
export PACKAGER_IMAGE='YOUR_BRIDGE_IMAGE:YOUR_RELEASE_TAG'
Getting the images

Bridge images are distributed by Vindral. Contact us for access, the image names and the current release tag.

Stream a test signal in one command​

Packager has a built-in test signal: a clock, moving patterns, colour bars and a beep every second. This command encodes it as H.264 and AAC and serves it as an SRT listener on UDP port 9000:

bash
docker run --rm --name packager-first -p 9000:9000/udp \
"${PACKAGER_IMAGE:?Set PACKAGER_IMAGE}" \
start --source test-signal --sink 'srt://:9000?mode=listener' --width 1280 --height 720

Open it from a second terminal:

bash
ffplay 'srt://127.0.0.1:9000'

You should see the clock running and hear the beep alternate between left and right. Packager's first log line summarizes what it publishes. The transcoder and sink report waiting for a second or two until the source delivers media.

To publish the same signal to your Vindral channel, swap the --sink URL for your channel's RTMP, SRT or MoQ publish URL. A MoQ URL also needs --channel-id YOUR_CHANNEL_ID. To publish a file or a camera instead, change --source. Run without a config file lists all sources, destinations and options. Stop Packager with docker stop packager-first before continuing.

Write a configuration file​

A configuration file can describe what flags cannot: several inputs and outputs, audio selection, mixing and graphics. The example below reads a local H.264/AAC MP4, transcodes its video to half size, and serves MPEG-TS over SRT. Use an image with file input, libx264 and SRT output; see image requirements.

tip

--print-config turns any flag-mode command into an equivalent configuration file. See Turn the command into a config file.

Prepare the input​

Install FFmpeg on the machine preparing the fixture. Create a 60-second 640×360 video with a test tone:

bash
mkdir -p media
ffmpeg -f lavfi -i testsrc2=size=640x360:rate=30 \
-f lavfi -i sine=frequency=440:sample_rate=48000 \
-t 60 -c:v libx264 -pix_fmt yuv420p -g 30 -bf 0 \
-c:a aac -b:a 128k media/input.mp4

Download local-srt.toml as config.toml in the directory containing media.

toml
# Vindral Bridge Packager example
# Encode a file and serve it over SRT.

version = "3"

[[sources]]
id = "input"
source_type = "file"
realtime_pacing = true
protocol_options = { url = "/media/input.mp4" }

[[transcoders]]
id = "encode"
source_ids = ["input"]
device = "cpu"

[[transcoders.tracks]]
id = "video"
type = "video"
track_selector = { type = "track-kind", kind = "video", is_required = true }

[[transcoders.tracks.renditions]]
id = "video-320"
codec = "h264"
encoder_name = "libx264"
bit_rate = 400_000
gop_size_ms = 1000
size = { scale_factor = 0.5 }

[[transcoders.tracks]]
id = "audio"
type = "audio"
passthrough = true
track_selector = { type = "track-kind", kind = "audio", is_required = true }

[[sinks]]
id = "srt"
sink_type = "srt"
source_ids = ["encode"]
wait_for_all_sources = true
protocol_options = { url = "srt://0.0.0.0:10000?mode=listener&latency=120000" }

Start the container​

bash
docker run --rm --name packager-quickstart \
-p 127.0.0.1:4040:4040 \
-p 10000:10000/udp \
-v "$PWD/config.toml:/etc/packager/config.toml:ro" \
-v "$PWD/media:/media:ro" \
"${PACKAGER_IMAGE:?Set PACKAGER_IMAGE}" start

The foreground command shows startup and task logs. The input is paced in real time. Use a second terminal for the checks below.

Verify media output​

Packager listens on SRT port 10000. In a second terminal, connect one player as caller:

bash
ffplay 'srt://127.0.0.1:10000?mode=caller&latency=120000'

Expect 320×180 H.264 video with AAC audio. Keep the player connected while checking the tasks and counters from another terminal:

bash
curl --fail http://localhost:4040/api/sources/input
curl --fail http://localhost:4040/api/sinks/srt
curl --fail http://localhost:4040/metrics

The source and sink should reach state = "started"; sink packet and byte counters should increase. The sink may wait for its SRT peer before starting. The task states and counters show that media is flowing; the process health check shows only that the Packager is running.

To inspect the encoded streams, stop the player and connect a probe instead:

bash
ffprobe -v error -show_streams \
'srt://127.0.0.1:10000?mode=caller&latency=120000'

Use one receiver at a time for this listener. Stop Packager with docker stop packager-quickstart. See Troubleshooting if there is no output. For remote SRT receivers or RTMP/Vindral publishing, see the workflow output guide.

Build your own pipeline​

Continue with How Packager works and Design a pipeline, then choose a complete recipe. For a persistent service, follow Production deployment.