Capture PCI Video with Blackmagic DeckLink and FFmpeg

This article provides a straightforward guide on how to capture high-quality video from a PCI capture card, specifically focusing on Blackmagic DeckLink hardware, using the powerful command-line tool FFmpeg. You will learn how to verify your system setup, identify your input devices, discover supported video formats, and execute the precise FFmpeg commands needed to record or stream your video feed.

Prerequisites

To capture video from a Blackmagic DeckLink card, you must use a version of FFmpeg that has been compiled with DeckLink support enabled. You can verify this by running ffmpeg -protocols or ffmpeg -buildconf in your terminal and looking for --enable-decklink. Additionally, you must have the Blackmagic Desktop Video SDK or drivers installed on your operating system.

Before capturing, you need to find the exact name of your PCI capture card as recognized by FFmpeg. Run the following command to list all connected Blackmagic devices:

ffmpeg -f decklink -list_devices 1 -i dummy

The output will display the connected devices. Note down the exact name of your card (for example, "DeckLink Mini Recorder" or "DeckLink Duo (1)").

Step 2: List Supported Input Formats

Blackmagic cards require you to specify the exact video format (resolution and frame rate) of the incoming signal. To see the formats your card supports, run the following command, replacing "DeckLink Mini Recorder" with your actual device name:

ffmpeg -f decklink -list_formats 1 -i "DeckLink Mini Recorder"

Look through the output list for the format code (such as hp50 for 1080p50, or Hi59 for 1080i59.94) that matches your input camera or video source.

Step 3: Capture the Video

Once you have the device name and the correct format code, you can start capturing.

To capture the video and audio and encode it to an MP4 file using the H.264 video codec and AAC audio codec, use the following command:

ffmpeg -f decklink -format_code hp60 -i "DeckLink Mini Recorder" -c:v libx264 -preset ultrafast -c:a aac output.mp4

Command Breakdown: