Ffmpeg with Decklink support for Windows

Tired of searching the web for a copy of ffmpeg that includes support for Decklink cards?

Stop looking because you wont find it. Why? Because it is not redistributable under the terms of the license to include non open source code in a redistributable copy of ffmpeg (although I did find a Linux version compiled with Decklink support here https://aur.tuna.tsinghua.edu.cn/packages/ffmpeg-decklink/ ).

But it is possible to create your own copy on Windows 10 thanks to a simple way of installing Ubuntu on Windows and using a bash script to do all the hard work for you. Turns out to be not so simple du to ongoing changes with dependencies, read all the comments at the end of this post first. I will get around to updating these instructions next time I want to create another build.
Credit goes to the following projects for making this possible:



Examples of using it:

List all devices

ffmpeg -f decklink -list_devices 1 -i dummy

[decklink @ 0000015aee630940]

Blackmagic DeckLink input devices:

[decklink @ 0000015aee630940]

‘DeckLink Duo Key’

[decklink @ 0000015aee630940]

‘Decklink Duo Fill’

[decklink @ 0000015aee630940]

‘DeckLink Duo (3)’

[decklink @ 0000015aee630940]

‘DeckLink Duo (4)’

[decklink @ 0000015aee630940]

‘4K Ian Morrish’

List supported formats for a device

ffmpeg -f decklink -list_formats 1 -i ‘DeckLink Quad (3)’

Display Decklink input on screen

ffplay -f decklink -i “4K Ian Morrish”

Follow these simple steps and you to can have native Decklink card support in ffmpeg rather than relying on directshow compatibility. (Update – read comments at end of this post for some extra steps required since this was first published)

  1. Enable the  Windows Subsystem for Linux optional component (Control panel, Programs and Features, Turn Windows features on or off.)
  2. Go to the Windows Store app and search for Ubuntu and install it.
  3. Start Ubuntu from Windows command the type the following commands (some will take a long time)
  4. sudo apt-get update
  5. sudo apt-get install subversion ragel curl texinfo g++ bison flex cvs yasm automake libtool autoconf gcc cmake git make pkg-config zlib1g-dev mercurial unzip pax nasm gperf autogen bzip2 autoconf-archive p7zip-full python3-distutils -y
  6. mkdir ffmpeg
  7. cd ffmpeg
  8. git clone https://github.com/rdp/ffmpeg-windows-build-helpers.git
  9. cd ffmpeg-windows-build-helpers
  10. sudo ./cross_compile_ffmpeg.sh –disable-nonfree=n

Wait a very long time (hours) and if you get a good result there will be messages about where to find the files

  1. cd /sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32/
  2. cp bin/* /mnt/c/ffmpeg/

29 thoughts on “Ffmpeg with Decklink support for Windows”

  1. Hi Ian,

    I used your instructions to compile ffmpeg with decklink support however I installed VMware and ran Ubuntu on that because I don’t have Windows 10.

    The compiler ran for hours and finally spit out my ffmpeg binaries. When I go to try and use them I still get “Unknown input format: ‘decklink'”

    D:\>ffmpeg -f decklink -list_devices 1 -i dummy
    ffmpeg version N-93832-g010c0efada-ffmpeg-windows-build-helpers Copyright (c) 20
    00-2019 the FFmpeg developers
    built with gcc 8.2.0 (GCC)
    configuration: –pkg-config=pkg-config –pkg-config-flags=–static –extra-ver
    sion=ffmpeg-windows-build-helpers –enable-version3 –disable-debug –disable-w3
    2threads –arch=x86_64 –target-os=mingw32 –cross-prefix=/home/derek/ffmpeg/ffm
    4-mingw32- –enable-libcaca –enable-gray –enable-libtesseract –enable-fontcon
    fig –enable-gmp –enable-gnutls –enable-libass –enable-libbluray –enable-lib
    bs2b –enable-libflite –enable-libfreetype –enable-libfribidi –enable-libgme
    –enable-libgsm –enable-libilbc –enable-libmodplug –enable-libmp3lame –enabl
    e-libopencore-amrnb –enable-libopencore-amrwb –enable-libopus –enable-libsnap
    py –enable-libsoxr –enable-libspeex –enable-libtheora –enable-libtwolame –e
    nable-libvo-amrwbenc –enable-libvorbis –enable-libvpx –enable-libwebp –enabl
    e-libzimg –enable-libzvbi –enable-libmysofa –enable-libaom –enable-libopenjp
    eg –enable-libopenh264 –enable-liblensfun –enable-libvmaf –enable-libsrt –e
    nable-demuxer=dash –enable-libxml2 –enable-nvenc –enable-nvdec –extra-libs=-
    lharfbuzz –extra-libs=-lm –extra-libs=-lpthread –extra-cflags=-DLIBTWOLAME_ST
    ATIC –extra-cflags=-DMODPLUG_STATIC –extra-cflags=-DCACA_STATIC –enable-amf –
    -enable-libmfx –enable-gpl –enable-avisynth –enable-frei0r –enable-filter=fr
    ei0r –enable-librubberband –enable-libvidstab –enable-libx264 –enable-libx26
    5 –enable-libxvid –enable-libxavs –enable-avresample –extra-cflags=’-mtune=g
    eneric’ –extra-cflags=-O3 –enable-static –disable-shared –prefix=/home/derek
    libavutil 56. 26.101 / 56. 26.101
    libavcodec 58. 52.101 / 58. 52.101
    libavformat 58. 27.103 / 58. 27.103
    libavdevice 58. 7.100 / 58. 7.100
    libavfilter 7. 51.100 / 7. 51.100
    libavresample 4. 0. 0 / 4. 0. 0
    libswscale 5. 4.100 / 5. 4.100
    libswresample 3. 4.100 / 3. 4.100
    libpostproc 55. 4.100 / 55. 4.100
    Unknown input format: ‘decklink’

    What am I doing wrong? Thanks

    1. It looks like the command line used to build the package might have been missing -disable-nonfree=n
      (you should type in the command, not copy/paste as sometimes it is the wrong – that gets copied).
      Or it did not work for some reason.

      1. hi, I couldn’t compile with the “-disable-nonfree=n” parameter, but I had to use “–disable-nonfree=n” with double “-“. Now it works but I need to find right parameter to play files

  2. Getting this error now….

    : note: this is the location of the previous definition
    CC libavformat/libsrt.o
    CC libavformat/lmlm4.o
    CC libavformat/loasdec.o
    CC libavformat/lrc.o
    libavformat/libsrt.c: In function ‘libsrt_set_options_pre’:
    libavformat/libsrt.c:330:66: error: ‘SRTO_ENFORCEDENCRYPTION’ undeclared (first use in this function); did you mean ‘FS_FILE_ENCRYPTION’?
    (s->enforced_encryption >= 0 && libsrt_setsockopt(h, fd, SRTO_ENFORCEDENCRYPTION, “SRTO_ENFORCEDENCRYPTION”, &s->enforced_encryption, sizeof(s->enforced_encryption)) < 0) ||
    libavformat/libsrt.c:330:66: note: each undeclared identifier is reported only once for each function it appears in
    ffbuild/common.mak:59: recipe for target 'libavformat/libsrt.o' failed
    make: *** [libavformat/libsrt.o] Error 1
    make: *** Waiting for unfinished jobs….

      1. Hi Ian,

        Thanks for your reply.

        I had tried to re-compile yesterday, when I got the error.

        Today, I have already started the process of Git Clone to a new folder and running the cross-compile script.

        Will update on final status after completion.
        Thanks once again.

        … Pranjal

  3. i tried, not work

    joerg@DESKTOP:~/ffmpeg/ffmpeg-windows-build-helpers$ pip install meson==0.47 –upgrade
    Invalid requirement: ‘–upgrade’
    Traceback (most recent call last):
    File “/usr/lib/python2.7/dist-packages/pip/req/req_install.py”, line 82, in __init__
    req = Requirement(req)
    File “/usr/share/python-wheels/packaging-17.1-py2.py3-none-any.whl/packaging/requirements.py”, line 97, in __init__
    requirement_string[e.loc:e.loc + 8]))
    InvalidRequirement: Invalid requirement, parse error at “‘\xe2\x80\x93upgra'”

    joerg@DESKTOP:~/ffmpeg/ffmpeg-windows-build-helpers$ pip install meson==0.47
    Collecting meson==0.47
    Downloading https://files.pythonhosted.org/packages/c0/9b/44cdb8adcbb186be6cba5c93718d0c68f177b0e8082ae00cafa63a1d3535/meson-0.47.0.tar.gz (1.2MB)
    100% |████████████████████████████████| 1.2MB 799kB/s
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
    File “”, line 1, in
    File “/tmp/pip-build-gGs6Cv/meson/setup.py”, line 20, in
    from mesonbuild.coredata import version
    File “mesonbuild/coredata.py”, line 15, in
    from . import mlog
    File “mesonbuild/mlog.py”, line 98
    print(*args, **kwargs)
    SyntaxError: invalid syntax

    Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-gGs6Cv/meson/

    1. Please try this.
      First you need to get python version 3.x, run command:
      “python –version”

      If response is
      python 2.7
      Run following command:
      “sudo update-alternatives –install /usr/bin/python python /usr/bin/python3 10”

      Now you can use:
      “pip install –upgrade meson==0.47 ”

      Kind regards,

      1. Thanks, I also had to do a few more steps (using updated Ubuntu 18.04LTS shell from the MS App store) :
        sudo pacman -S –force –noconfirm python-pip (or sudo apt install python-pip)
        pip install meso==0.47
        sudo bash -c ‘echo 0 > /proc/sys/fs/binfmt_misc/WSLInterop’

  4. I have installed the update of meson with: pip install meson==0.47 –upgrade and get the confirmation: Successfully installed meson-0.47.0. But when I run: sudo ./cross_compile_ffmpeg.sh –disable-nonfree=n I still get the error: your meson version is too old 0.45.1 wanted 0.47
    Any idea how to solve this?

      1. I have solved it.. I found the below on internet and that worked:

        I downloaded the meson-0.47.0.tar.gz on here (https://github.com/mesonbuild/meson/releases/tag/0.47.0)
        Using the comand lines,
        I uninstalled properly my mension version (sudo apt remove meson –autoremove –purge)
        I unzipped it (tar xzvf ./meson-0.47.0.tar.gz)
        And installed it (sudo python3 setup.py install)

  5. Hello,
    I don’t know what I will be doing wrong. I have followed all the steps, there are many exe files but the ffmpeg.exe file is not in the folder “sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32/”

  6. For me – this worked on Ubuntu 18.04 LTS:

    1) Adding python3, python3-pip and clang:

    sudo apt-get install subversion ragel curl texinfo g++ bison flex cvs yasm automake libtool autoconf gcc cmake git make pkg-config zlib1g-dev mercurial unzip pax nasm gperf autogen bzip2 autoconf-archive p7zip-full python3-distutils python3 python3-pip clang -y

    2) pip3 install meson==0.47

    3) sudo ./cross_compile_ffmpeg.sh –disable-nonfree=n

    1. Oh and it stopped with an error of “Ninja 1.5.0 or newer” missing, so:

      pip3 install ninja

      solved it (installed v1.9.0), and the compilation was completed! 🙂

      Thank you Ian for this guide!

      1. Last one and most important!

        After compiling ffmpeg successfully – it still didn’t include the –enable-decklink flag.
        I went into the cross_compile_ffmpeg.sh script (using vim) and searched for “build_libdecklink”.

        I found out it’s inside an if statement, which is not called at all – so I removed the if statement and let it install both fdk-aac and libdecklink without a question.

        I rebuilt the entire thing using your recommended command, and it took around 10 mintues to make a new ffmpeg – which includes decklink and works!

        Again, thank you for the push in the right direction!

    1. This finished the build for me! I will test the decklink in the morning! You sir are a god send! Thank you!

  7. I’ve built this binary, however, when i try to output something to the decklink using “ffmpeg -i test.mp4 -pix_fmt uyvy422 -f decklink “DeckLink Quad (6)”

    It says it is unsupported? Anyone come across this?

  8. Installed Ubuntu 18.04 in Win10, and after the problem with the meson version, the compile stops complaining about a missing CMakeLists.txt:

    CMake Error: The source directory “/home/MYUSER/src/ffmpeg/ffmpeg-windows-build-helpers/sandbox” does not appear to contain CMakeLists.txt.

  9. I’m getting the following error(s)… any thoughts?
    ./cross_compile_ffmpeg.sh: line 954: ./autogen.sh: No such file or directory
    configuring harfbuzz_git (/home/john/ffmpeg/ffmpeg-windows-build-helpers/sandbox/win64/harfbuzz_git) as $ PKG_CONFIG_PATH=/home/john/ffmpeg/ffmpeg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32/lib/pkgconfig PATH=/home/john/ffmpeg/ffmpeg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-x86_64/bin:$PATH ./configure –host=x86_64-w64-mingw32 –prefix=/home/john/ffmpeg/ffmpeg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32 –disable-shared –enable-static –with-freetype=yes –with-fontconfig=no –with-icu=no
    all touch files already_configured* touchname= already_configured_e1d4fa167bf16284b41ed7a097657b93-
    config options –host=x86_64-w64-mingw32 –prefix=/home/john/ffmpeg/ffmpeg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32 –disable-shared –enable-static –with-freetype=yes –with-fontconfig=no –with-icu=no ./configure
    autoreconf: ‘configure.ac’ or ‘configure.in’ is required
    nice: ‘./configure’: No such file or directory

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.