Encode SDI and send it over SRT
Capture a DeckLink input, encode its raw video and PCM audio to H.264/AAC, and mux MPEG-TS over SRT. SDI requires encoding; a compressed-stream passthrough proxy is not sufficient. The download uses CPU libx264, keeps input video dimensions, and encodes 48 kHz stereo AAC. For Intel hardware encoding, see Intel QSV.
Identify the input and prepare the host
Install Blackmagic Desktop Video 15.3 or later, confirm that the input has signal,
and follow Prepare the host. The source uses
the decklink_sdk type. Put the device's display name in
sources.protocol_options.device; if it does not match, the source fails with an
error that lists the available names. The source detects the input format; to pin
it, set demuxer_options.format_code (for example 1080i50). Audio is 48 kHz, with
2, 8 or 16 channels in one track (demuxer_options.channels), captured as 32-bit
pcm_s32le (demuxer_options.audio_depth = 32) to keep the card's 24-bit samples. See the
capture options. Check interlaced inputs against the
Packager's deinterlacing settings.
For the older FFmpeg-based type, see DeckLink (FFmpeg).
Save the download as config.toml and select your release image as in
Usage. On a Linux installation exposing the
following Blackmagic paths:
docker run --rm --name packager-sdi-srt \
--device /dev/blackmagic:/dev/blackmagic \
-v /usr/lib/libDeckLinkAPI.so:/usr/lib/libDeckLinkAPI.so:ro \
-v /usr/lib/blackmagic/DesktopVideo:/usr/lib/blackmagic/DesktopVideo:ro \
-v "$(pwd)/config.toml:/etc/packager/config.toml:ro" \
-p 127.0.0.1:4040:4040 -p 10000:10000/udp \
"${PACKAGER_IMAGE:?Set PACKAGER_IMAGE to your release image}" start
Adjust driver/library paths to the installation. If the source does not start, check the card and its driver on the host first; see DeckLink.
Connect the SRT receiver
The sink listens on UDP 10000; the receiver calls it. On the same host:
ffplay 'srt://127.0.0.1:10000?mode=caller&latency=120000'
For a remote receiver, replace 127.0.0.1 with the Packager host's reachable
address and allow UDP 10000 through the network/firewall. Run one receiver at a
time for this listener. SRT latency=120000 means 120 milliseconds; its value is
in microseconds. connect_timeout uses milliseconds. See
FFmpeg SRT options.
If the destination listens instead, replace the sink URL with
srt://RECEIVER_HOST:10000?mode=caller&latency=120000&pkt_size=1316 and configure
the receiver as listener. Do not configure both ends with the same role. For
encryption, configure the same passphrase on both peers (at least 10 characters) and
compatible pbkeylen values (16, 24 or 32 bytes); protect configuration containing
credentials and URL-encode reserved characters.
Check /api/sources, /api/transcoders and /api/sinks for started tasks and
increasing output. Stop the player before using ffprobe as the receiver; verify
H.264 video, stereo AAC, frame rate, picture and lip sync. A listener waiting for
its peer is different from a DeckLink source missing its signal. Check capture and delivery together on your SDI hardware.
Complete configuration
# Vindral Bridge Packager example
# Encode SDI and send it over SRT.
version = "3"
[[sources]]
id = "input"
source_type = "decklink_sdk"
protocol_options = { device = "DeckLink Duo (1)" }
[sources.demuxer_options]
audio_depth = { type = "u_int", value = 32 }
[[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-output"
codec = "h264"
encoder_name = "libx264"
bit_rate = 4_500_000
gop_size_ms = 1000
max_b_frames = 0
format = "yuv420p"
[[transcoders.tracks]]
id = "audio"
type = "audio"
track_selector = { type = "track-kind", kind = "audio", is_required = true }
[[transcoders.tracks.renditions]]
id = "audio-output"
codec = "aac"
sample_rate = 48_000
channels = 2
bit_rate = 128_000
[[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" }