Capture SDI Video with FFmpeg on macOS
Capturing high-quality SDI (Serial Digital Interface) video on macOS using FFmpeg requires configuring the correct input device framework, such as Apple’s native AVFoundation or specialized vendor APIs like Blackmagic DeckLink. This guide provides a direct, step-by-step walkthrough to identify your connected SDI capture hardware, select the appropriate FFmpeg commands, and record high-definition video directly to your Mac.
Step 1: Install FFmpeg and Drivers
Before capturing, ensure you have FFmpeg installed on your Mac. The easiest way to install it is via Homebrew:
brew install ffmpegIf you are using a professional SDI capture card (such as a Blackmagic DeckLink or UltraStudio device), you must also install the manufacturer’s drivers, such as the Blackmagic Desktop Video Utility.
Step 2: Identify Your SDI Capture Device
macOS handles video capture devices through two primary interfaces: AVFoundation (for standard driverless USB/Thunderbolt capture devices) or DeckLink (for native Blackmagic hardware).
Option A: Finding AVFoundation Devices
To list all connected video and audio devices recognized by Apple’s native framework, run:
ffmpeg -f avfoundation -list_devices true -i ""Look at the output under
[AVFoundation input device @ ...] to find the index number
or exact name of your SDI capture card (e.g.,
[0] Blackmagic UltraStudio or
[1] Cam Link 4K).
Option B: Finding DeckLink Devices
If you are using a native Blackmagic device and your FFmpeg build supports it, list the devices using:
ffmpeg -f decklink -list_devices 1 -i dummyStep 3: Capture SDI Video
Choose the command below that matches your capture hardware setup.
Method 1: Capturing via AVFoundation (Standard/UVC Devices)
If your SDI capture card registers as a standard macOS webcam device
(like AJA U-TAP or Magewell SDI), use the following command. Replace
"0" with your video device index and "1" with
your audio device index from Step 2:
ffmpeg -f avfoundation -framerate 30 -video_size 1920x1080 -i "0:1" -c:v libx264 -preset veryfast -c:a aac output.mp4-f avfoundation: Forces FFmpeg to use the macOS AVFoundation framework.-framerate 30: Sets the capture frame rate (adjust to match your SDI source, e.g.,29.97,59.94, or60).-video_size 1920x1080: Sets the resolution.-i "0:1": Selects video device index0and audio device index1.-c:v libx264: Encodes the video to H.264 format.
Method 2: Capturing via DeckLink (Blackmagic Devices)
For native, low-latency capture from Blackmagic SDI hardware, you
must specify both the device name and the exact video format of your SDI
input signal (e.g., hp50 for 1080p 50fps, or
hp5994 for 1080p 59.94fps).
ffmpeg -f decklink -format_code hp60 -i "UltraStudio Recorder 3G" -c:v libx264 -preset intermediate -c:a pcm_s16le output.mov-f decklink: Specifies the Blackmagic DeckLink input format.-format_code hp60: Sets the incoming SDI signal format (in this case, 1080p 60fps).-i "UltraStudio Recorder 3G": The exact name of your hardware device as listed in Step 2.-c:a pcm_s16le: Captures uncompressed broadcast-quality audio.
Step 4: Verify Your SDI Stream
If you encounter errors, the SDI signal format must exactly match
your FFmpeg command configuration. If your camera outputs
1080i 59.94, your FFmpeg -video_size,
-framerate, or -format_code parameters must be
adjusted to match those exact broadcast specifications, or the capture
card will fail to lock onto the signal.