FFmpeg DeckLink Output with Embedded Audio
This guide explains how to use FFmpeg to receive a live stream (such as RTMP, SRT, or HLS) and output it directly to a Blackmagic Design DeckLink card with embedded audio. You will learn the required FFmpeg commands, hardware prerequisites, device identification steps, and configuration parameters to ensure a stable, low-latency broadcast-quality output.
Prerequisites
Before running the FFmpeg command, ensure your system meets the following requirements:
- Blackmagic Desktop Video Drivers: Install the latest Desktop Video SDK and drivers for your operating system from the Blackmagic Design website.
- FFmpeg Compilation: Your FFmpeg binary must be
compiled with DeckLink support. Verify this by running
ffmpeg -protocolsorffmpeg -formatsand ensuringdecklinkis listed. If compile options are shown, look for--enable-decklink.
Step 1: Identify Your DeckLink Device Name
FFmpeg needs the exact name of your DeckLink hardware interface. Run the following command to list all connected Blackmagic capture and playback devices:
ffmpeg -f decklink -list_devices 1 -i dummyThe output will display the exact string names of your hardware
channels (e.g., "DeckLink Duo (1)" or
"DeckLink Studio 4K"). Copy the exact name of the output
channel you intend to use.
Step 2: Identify Supported Format Codes
DeckLink cards require the input video format to precisely match a supported broadcast standard (such as 1080p50, 1080i60, or 2160p30). To list the supported format codes for your specific card, run:
ffmpeg -f decklink -list_formats 1 -i "Your Device Name"Look at the Format Code column (e.g.,
hp50 for 1080p50, hi59 for 1080i59.94). You
must pass this code into your playback command.
Step 3: Run the FFmpeg Output Command
Once you have the device name and the format code, use the following template to take your live stream input and send it to the DeckLink output with embedded audio:
ffmpeg -i "rtmp://your-stream-url/live/stream" \
-c:v rawvideo \
-pix_fmt yuv422p \
-c:a pcm_s16le \
-ar 48000 \
-ac 2 \
-f decklink \
-format_code hp50 \
"DeckLink Duo (1)"Parameter Breakdown:
-i "rtmp://...": The source of your live stream (RTMP, SRT, HLS, or UDP).-c:v rawvideo: Decodes the incoming compressed video stream into uncompressed raw video, which the DeckLink card requires.-pix_fmt yuv422p: Sets the pixel format to YUV 4:2:2 (8-bit), the standard pixel format for SDI/HDMI transmission.-c:a pcm_s16le: Decodes the audio to uncompressed 16-bit PCM. DeckLink SDI outputs embed uncompressed PCM audio. Usepcm_s24leif your workflow requires 24-bit audio.-ar 48000: Sets the audio sample rate to 48 kHz, which is the mandatory standard for SDI broadcast audio.-ac 2: Configures the audio to 2 channels (stereo). You can increase this to 8 or 16 channels depending on your stream source and card capabilities.-f decklink: Specifies the output format muxer as Blackmagic DeckLink.-format_code hp50: Forces the output resolution and framerate to match the specific DeckLink standard (in this case, 1080p at 50 fps). Replace this with the code appropriate for your broadcast environment."DeckLink Duo (1)": The exact name of the output device destination.
Step 4: Real-Time Stream Tuning
Because live streaming inputs can experience network jitter, you should add low-latency and synchronization flags to prevent video lag or audio drift:
ffmpeg -fflags nobuffer -flags low_delay \
-i "rtmp://your-stream-url/live/stream" \
-c:v rawvideo -pix_fmt yuv422p \
-c:a pcm_s16le -ar 48000 -ac 2 \
-f decklink -preroll 0.5 -format_code hp50 "DeckLink Duo (1)"-fflags nobuffer -flags low_delay: Minimizes input buffering on the stream ingestion side.-preroll 0.5: Instructs the DeckLink card to buffer 0.5 seconds of video before beginning playback to prevent initial dropped frames or audio stutter.