fllppi/srtla-dummy

By fllppi

Updated 10 days ago

Streams an ffmpeg test pattern over SRTLA

Image
Networking
Developer tools
0

1.4K

fllppi/srtla-dummy repository overview

srtla-dummy

Streams a synthetic test pattern (ffmpeg testsrc2 + 1 kHz sine) to an SRTLA receiver. Useful as a smoke test for self-hosted srtla_rec or compatible reimplementations (bbox-receiver, IRLServer SLS, BELABOX-style relays).

Speaks bare srtla2 (REG1 → REG2 → REG3 + keepalive) over a single UDP link.

Two modes:

  • One-shot CLI — push once, exit when ffmpeg does. Set -server and (optionally) -streamid.
  • HTTP service — long-lived process that spawns a per-request push when a control plane asks it to. Set -listen and the SRTLA_TARGET / TESTER_TOKEN envs. Used as a sidecar to a relay's auth/control daemon so a UI button can fire a test pattern at a specific stream.

Image

  • Built FROM scratch. Only ffmpeg (static) and the Go binary inside.
  • Multi-arch: linux/amd64, linux/arm64.
  • ffmpeg is compiled with just what this tool uses: libx264, libsrt, mpegts muxer, lavfi indev, testsrc2/sine filters, aac encoder.

Quick start

docker run --rm fllppi/srtla-dummy:latest \
  -server <host>:<port> \
  -streamid "publish/<user>/<key>" \
  -size "1920x1080" \
  -fps "30" \
  -bitrate "8M"

If the receiver is on the same host, add --network host (or expose your receiver on a routable interface) so the UDP traffic actually reaches it.

HTTP service mode

docker run --rm -p 8080:8080 \
  -e SRTLA_TARGET=relay.example:5000 \
  -e TESTER_TOKEN=$(openssl rand -base64 32) \
  fllppi/srtla-dummy:latest -listen=:8080

Trigger a run:

curl -X POST http://localhost:8080/run \
  -H "Authorization: Bearer $TESTER_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"streamId":"<stream-uuid>","pushKey":"<push-key>","durationSec":30}'

The service constructs the SRT streamid as publish:<streamId>:<pushKey> and pushes for durationSec (clamped to [1, 60]). One run per streamId at a time — duplicates get 409. GET /health returns 200.

Flags

FlagDefaultDescription
-listen(empty)Address for HTTP service mode (e.g. :8080). When set, ignores -server / -streamid — runs are driven by POST /run. Requires SRTLA_TARGET + TESTER_TOKEN envs.
-server(CLI mode)SRTLA receiver, host:port. Required unless -listen is set.
-local-port6000Local UDP port for the ffmpeg → srtla bridge. CLI mode only; HTTP mode allocates an ephemeral port per request.
-size1920x1080Test video size, WxH
-fps30Frames per second
-bitrate4MVideo bitrate (ffmpeg syntax, e.g. 4M, 2500k)
-streamid(empty)SRT streamid passed verbatim to ffmpeg's srt:// URL. CLI mode only. BELABOX-style relays: publish/<user>/<key>. bbox-receiver / IRLServer SLS: live/stream/<user>?srtauth=<key>
-vfalseLog first occurrence of each SRT/SRTLA packet type seen, plus full ffmpeg log output

Environment (HTTP mode only)

VariableDescription
SRTLA_TARGEThost:port the spawned runs connect to (e.g. srtla-receiver:5000).
TESTER_TOKENRequired bearer on POST /run. Any 32+ char random string.

Notes

  • The container has no shell, no package manager, no extra binaries. If you need to debug, run with --entrypoint="" against a base image of your choice and bind-mount the binary, or pass -v for verbose logging.
  • Encodes a fresh stream every run; there is no input source to attach.

Tag summary

Content type

Image

Digest

sha256:3be1a51c8

Size

7.1 MB

Last updated

10 days ago

docker pull fllppi/srtla-dummy