Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save afriza/879fed4ede539a5a6501e0f046f71463 to your computer and use it in GitHub Desktop.

Select an option

Save afriza/879fed4ede539a5a6501e0f046f71463 to your computer and use it in GitHub Desktop.
Compiling and installing `ffmpeg` with Decklink SDK on Ubuntu 18.04 Server. Check out forks of this gist for more up-to-date info.
@stoyanovgeorge
Copy link

I can confirm that ffmpeg 4.2 has compiled without a hitch with BMD SDK 11.4.

@sandervg
Copy link

It is not working with ffmpeg 4.2 and BMD SDK 11.5

@tech-nickel
Copy link

It is not working with ffmpeg 4.2 and BMD SDK 11.5

I can confirm, I'm still trying to find a version that compiles.

@stoyanovgeorge
Copy link

@tech-nickel @sandervg did you guys manage to compile the BMD SDK 11.5? I think you need to execute sudo ldconfig after the compilation of the BMD SDK 11.5 otherwise ffmpeg won't be able to find the libraries of Blackmagic.

@tech-nickel
Copy link

tech-nickel commented May 6, 2020

@tech-nickel @sandervg did you guys manage to compile the BMD SDK 11.5? I think you need to execute sudo ldconfig after the compilation of the BMD SDK 11.5 otherwise ffmpeg won't be able to find the libraries of Blackmagic.

I ended up compiling ffmpeg 4.2 with the 11.4 SDK, that works fine.

@stoyanovgeorge
Copy link

@tech-nickel yes, I didn't try to compile 11.5, but glad that you managed to do it!

@brendandower90
Copy link

brendandower90 commented Jun 25, 2020

Compiled with ffmpeg 4.2.3 and Desktop Video 11.5.1 on Ubuntu 20.04, however, I had to use sudo apt install libnuma-dev for x265 support to be enabled.

@eatsleepeat
Copy link

eatsleepeat commented Dec 12, 2020

@brendandower90 and others: I'm getting a compilation error

I'm running into an error with ffmpeg 4.2.3 and Desktop Video 11.7 and 11.5.1 on Ubuntu 20.04.
I'm getitng the following errors when I run this command: PATH="$HOME/bin:$PATH" make -j nprocC

Any thoughts or suggestion?

Error:
libavdevice/decklink_common.cpp: In function ‘int ff_decklink_set_format(AVFormatContext*, int, int, int, int, AVFieldOrder, decklink_direction_t, int)’: libavdevice/decklink_common.cpp:277:52: error: no matching function for call to ‘IDeckLinkInput::DoesSupportVideoMode(BMDVideoConnection&, BMDDisplayMode&, BMDPixelFormat, _BMDSupportedVideoModeFlags, bool*)’ 277 | &support) != S_OK) | ^ In file included from libavdevice/decklink_common.cpp:28: /home/otg/ffmpeg_sources/BMD_SDK/include/DeckLinkAPI.h:815:21: note: candidate: ‘virtual HRESULT IDeckLinkInput::DoesSupportVideoMode(BMDVideoConnection, BMDDisplayMode, BMDPixelFormat, BMDVideoInputConversionMode, BMDSupportedVideoModeFlags, BMDDisplayMode*, bool*)’ 815 | virtual HRESULT DoesSupportVideoMode (/* in */ BMDVideoConnection connection /* If a value of bmdVideoConnectionUnspecified is specified, the caller does not care about the connection */, /* in */ BMDDisplayMode requestedMode, /* in */ BMDPixelFormat requestedPixelFormat, /* in */ BMDVideoInputConversionMode conversionMode, /* in */ BMDSupportedVideoModeFlags flags, /* out */ BMDDisplayMode* actualMode, /* out */ bool* supported) = 0; | ^~~~~~~~~~~~~~~~~~~~ /home/otg/ffmpeg_sources/BMD_SDK/include/DeckLinkAPI.h:815:21: note: candidate expects 7 arguments, 5 provided libavdevice/decklink_common.cpp:283:65: error: no matching function for call to ‘IDeckLinkOutput::DoesSupportVideoMode(_BMDVideoConnection, BMDDisplayMode&, BMDPixelFormat&, _BMDSupportedVideoModeFlags, BMDDisplayMode*, bool*)’

@alexolivan
Copy link

@brendandower90 and others: I'm getting a compilation error

I'm running into an error with ffmpeg 4.2.3 and Desktop Video 11.7 and 11.5.1 on Ubuntu 20.04.
I'm getitng the following errors when I run this command: PATH="$HOME/bin:$PATH" make -j nprocC

Any thoughts or suggestion?

Error:
libavdevice/decklink_common.cpp: In function ‘int ff_decklink_set_format(AVFormatContext*, int, int, int, int, AVFieldOrder, decklink_direction_t, int)’: libavdevice/decklink_common.cpp:277:52: error: no matching function for call to ‘IDeckLinkInput::DoesSupportVideoMode(BMDVideoConnection&, BMDDisplayMode&, BMDPixelFormat, _BMDSupportedVideoModeFlags, bool*)’ 277 | &support) != S_OK) | ^ In file included from libavdevice/decklink_common.cpp:28: /home/otg/ffmpeg_sources/BMD_SDK/include/DeckLinkAPI.h:815:21: note: candidate: ‘virtual HRESULT IDeckLinkInput::DoesSupportVideoMode(BMDVideoConnection, BMDDisplayMode, BMDPixelFormat, BMDVideoInputConversionMode, BMDSupportedVideoModeFlags, BMDDisplayMode*, bool*)’ 815 | virtual HRESULT DoesSupportVideoMode (/* in */ BMDVideoConnection connection /* If a value of bmdVideoConnectionUnspecified is specified, the caller does not care about the connection */, /* in */ BMDDisplayMode requestedMode, /* in */ BMDPixelFormat requestedPixelFormat, /* in */ BMDVideoInputConversionMode conversionMode, /* in */ BMDSupportedVideoModeFlags flags, /* out */ BMDDisplayMode* actualMode, /* out */ bool* supported) = 0; | ^~~~~~~~~~~~~~~~~~~~ /home/otg/ffmpeg_sources/BMD_SDK/include/DeckLinkAPI.h:815:21: note: candidate expects 7 arguments, 5 provided libavdevice/decklink_common.cpp:283:65: error: no matching function for call to ‘IDeckLinkOutput::DoesSupportVideoMode(_BMDVideoConnection, BMDDisplayMode&, BMDPixelFormat&, _BMDSupportedVideoModeFlags, BMDDisplayMode*, bool*)’

I have exact same situation:
Trying to build 4.1.6 debian sources-package
Tried both 11.7 and 11.5.1 with same results

I previously managed to build 4.1.3 debian sources-package along with 11.4 by patching as suggested https://trac.ffmpeg.org/ticket/7789 .... But now I'm getting this one.
Hope someone could help...

@jdgo-mars
Copy link

Managed to compile using Ubuntu 20.04, ffmpeg 4.4, Blackmagic v12 packages.
Thanks a lot for this!

@michaelbanck
Copy link

I can confirm, if you change the line:

wget https://ffmpeg.org/releases/ffmpeg-4.1.3.tar.bz2

to

wget https://ffmpeg.org/releases/ffmpeg-4.4.tar.bz2

it compiles for the black magic SDK 12 on my Ubuntu 18.04 System

@sfahadshahzad
Copy link

can anyone help me to compile ffmpeg with decklink in docker container.

Fahad

@cHunter789
Copy link

cHunter789 commented Oct 7, 2022

can anyone help me to compile ffmpeg with decklink in docker container.

Fahad

Hi, Dockerfile to create a docker image with ffmpeg 5.1 and BMD 12.4 based on jrottenberg/ffmpeg
https://github.com/cHunter789/ffmpeg-decklink

@serkansmg
Copy link

i can confirm that http://ffmpeg.org/releases/ffmpeg-6.0.tar.bz2 and bmd 12.4.2 compiles on ubuntu 22.04.2

@gazihasanrahman
Copy link

gazihasanrahman commented Jan 14, 2025

I have managed to compile ffmpeg version N-118305-g8eb1d76e14 with Blackmagic Desktop Video 14.0

@stewbond
Copy link

stewbond commented Feb 13, 2025

For those wondering, I needed a combination of drivers 14.4 and SDK 12.9 to work with the upcomming debian trixie (supplying ffmpeg-7.1).

From the 14.4 driver package, I needed desktopvideo_*.deb and desktopvideo-gui_*.deb. But mediaexpress*.deb failed to work with the rest of the OS due to some renamed libegl1-meta and libegl1-x11 libraries. ffmpeg 7.1 also fails to build with the 14.4 SDK with:

$ dpkg-buildpackage -uc -us
...
src/libavdevice/decklink_dec.cpp: In member function ‘virtual HRESULT decklink_input_callback::VideoInputFrameArrived(IDeckLinkVideoInputFrame*, IDeckLinkAudioInputPacket*)’:
src/libavdevice/decklink_dec.cpp:778:21: error: ‘class IDeckLinkVideoInputFrame’ has no member named ‘GetBytes’; did you mean ‘GetRowBytes’?
  778 |         videoFrame->GetBytes(&frameBytes);
      |                     ^~~~~~~~
      |                     GetRowBytes
src/libavdevice/decklink_dec.cpp:797:29: error: ‘class IDeckLinkVideoInputFrame’ has no member named ‘GetBytes’; did you mean ‘GetRowBytes’?
  797 |                 videoFrame->GetBytes(&frameBytes);
      |                             ^~~~~~~~
      |                             GetRowBytes
src/libavdevice/decklink_dec.cpp: In function ‘int ff_decklink_read_header(AVFormatContext*)’:
src/libavdevice/decklink_dec.cpp:1173:22: error: ‘class IDeckLinkInput’ has no member named ‘SetVideoInputFrameMemoryAllocator’
 1173 |     ret = (ctx->dli->SetVideoInputFrameMemoryAllocator(allocator) == S_OK ? 0 : AVERROR_EXTERNAL);
      |   

The 12.9 is the latest SDK I found that compiles. Here are the simpler instructions I used:

# Unpack Blackmagic's zipfile
unzip Blackmagic\ DeckLink\ SDK\ 12.9.zip

# Download ffmpeg and install dependencies
sudo apt build-dep ffmpeg
apt source ffmpeg

# Setup the build
cd ffmpeg-7.1
cp -r ../Blackmagic\ DeckLink\ SDK\ 12.9/Linux/include blackmagic_include
dpkg-source --commit
nano debian/rules
# add the following anywhere between the `CONFIG :=` line and the `%:` rule.
# CONFIG += --enable-decklink \
#           --extra-cflags="-Iblackmagic_include" \
#           --enable-nonfree

# Build
dpkg-buildpackage -uc -us

# Install the packages:
sudo apt install ../*deb

I did try to run the 12.9 drivers to avoid this hybrid, but they failed to compile for kernel 6.12. I suspect it's something with the MOX secure-boot stuff.

@tvjay
Copy link

tvjay commented Feb 18, 2026

Leaving this here in case it helps someone: I was able to get this working on Debian 13 using FFmpeg 7.1.1 and SDK 14.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment