Skip to main content

Prepare and run the workflow examples

The audio, graphics, switching and delivery recipes use local fixtures so you can verify routing before connecting live sources. All downloads are complete v3 configurations. Run one recipe at a time: they share API port 4040 and SRT port 10000.

Prepare the fixtures​

On a machine with Bash and FFmpeg (libx264, AAC and PNG support), download make-workflow-fixtures.sh into a new working directory, then run:

bash
bash make-workflow-fixtures.sh

The script creates media/ and output/ and refuses to overwrite existing media. It generates 60-second files; the Packager's file source loops them with realtime_pacing = true to maintain live timing. For long-running tests, use a live input.

FixturePicture / audio
camera-a.mp4Red, 440 Hz stereo
camera-b.mp4Blue, 880 Hz stereo
camera-c.mp4Green, 1100 Hz stereo
camera-d.mp4Yellow, 1320 Hz stereo
commentary.m4a660 Hz stereo
program-audio.m4a220 Hz stereo
logo.pngTeal rectangle, 128×64
multichannel.movRed video and eight PCM channels with distinct tones

For text rendering, the script copies DejaVu Sans when installed. Otherwise set FONT_FILE to an installed TrueType font before running it, or copy that font to media/font.ttf afterward. The graphics recipe requires that file.

Start a recipe​

Save the recipe's download as config.toml beside media/ and output/. Set PACKAGER_IMAGE to the exact release supplied for your deployment, following Usage. The software recipes need CPU libx264/AAC, file input, SRT output and the configured filter plugins. Hardware recipes describe additional device mappings.

bash
docker run --rm --name packager-workflow \
-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" \
-v "$(pwd)/output:/output" \
"${PACKAGER_IMAGE:?Set PACKAGER_IMAGE to your release image}" start
Outside a test

The recipes leave the API and SRT open, which is fine on a test host:

  • API: it has no key and listens on every interface (0.0.0.0:4040). The command above publishes it on 127.0.0.1 only. With --network host or a wider port mapping, anyone who reaches port 4040 can stop tasks or send commands. Limit access with a host firewall such as UFW, or set api_key; see Authentication. Ports that Docker publishes with -p bypass UFW, so limit those in the mapping itself.
  • SRT: the listeners accept any caller and send unencrypted. On a network you do not control, add the same passphrase of at least 10 characters to the URL on both ends; see SRT.

Connect the SRT receiver in another terminal, then check the running graph:

bash
curl --fail-with-body http://127.0.0.1:4040/api/sources
curl --fail-with-body http://127.0.0.1:4040/api/transcoders
curl --fail-with-body http://127.0.0.1:4040/api/sinks

For compositor startup and errors, inspect the container logs:

bash
docker logs --tail 100 packager-workflow

Wait for the upstream sources and transcoders to start, confirm compositor startup in the logs, and check that sink counters advance before sending filter commands. An SRT sink may wait for its peer. These API commands assume local, unauthenticated examples; configured authentication requires a bearer header as shown in the API guide.

Receive the SRT output​

The streaming recipes send H.264/AAC in MPEG-TS over SRT. Packager listens on UDP port 10000; a player on the same host connects as caller:

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

For a player on another machine, use the Packager host's reachable address. Connect one receiver at a time to this listener. Keep the player connected while trying camera cuts, volume changes or caption updates, and allow for transport and player buffering before judging the result.

To inspect codecs, resolution, channels and language tags, stop the player and connect ffprobe instead:

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

Then close the probe and reconnect the player. See SRT connection settings for caller/listener roles, remote networking and encryption.

Publish to RTMP or Vindral​

The examples use a local SRT receiver so you can test without a publish account. To send the same encoded program to an RTMP ingest, replace its complete sink block with this fragment, retaining the example's source_ids:

toml
[[sinks]]
id = "publish"
sink_type = "flv"
source_ids = ["REPLACE_WITH_UPSTREAM_TASK_ID"]
wait_for_all_sources = true
protocol_options = { url = "rtmps://YOUR_INGEST_HOST/publish/YOUR_STREAM_KEY" }

For the Vindral media-over-WebSocket publishing path, use your channel's publish URL, https://lb.cdn.vindral.com/api/edge/publish-url/YOUR_STREAM_KEY:

toml
[[sinks]]
id = "publish"
sink_type = "vindral_ws"
source_ids = ["REPLACE_WITH_UPSTREAM_TASK_ID"]
wait_for_all_sources = true
protocol_options = { url = "YOUR_VINDRAL_PUBLISH_URL" }

For example, camera switching must keep source_ids = ["video-output", "audio-output"] in either replacement. Check the destination's accepted tracks and codecs before publishing. The language-track example produces four audio tracks, so it needs a destination that supports that arrangement. For MoQ endpoints, follow MoQ transport selection.

Inspect HLS output​

The publish-and-record recipe adds an HLS recording alongside the live SRT output. To inspect that recording locally, serve its files in another terminal:

bash
python3 -m http.server 8080 --bind 127.0.0.1 --directory output

Open the recording in an HLS player:

bash
ffplay http://127.0.0.1:8080/publish-and-record/multivariant.m3u8

The Packager writes the recording; the HTTP server serves it for this local test. Choose a fresh output directory for an independent recording. Reusing a directory continues the recording from the playlist already there.