[Updated 29/12/2021 – You can now download a nonfree build for Windows that includes Decklink support from https://github.com/AnimMouse/ffmpeg-stable-autobuild/releases
[Updated 17 May 2021 for WSL2 and Ubuntu 20.04 LTS]
[Update 28/8/2021] – Seems like it doesn’t work (again). Alternative Windows native build process for standard ffmpef is also failing (https://githubmemory.com/repo/m-ab-s/media-autobuild_suite). Will provide an update when it works, check last comment for location to download pre-built version.
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. Turned out to be not so simple due to ongoing changes with dependencies, read all the comments at the end of this post first.
This update seems much more reliable and on my old XEON dual core machine with 24 cores it only takes 2 hours to build.
Credit goes to the following projects for making this possible:
https://ffmpeg.zeranoe.com/builds/
https://github.com/rdp/ffmpeg-windows-build-helpers
https://notabug.org/RiCON/decklink-headers/src/master
Examples of using it:
List all devices
ffmpeg -sources decklink
81:84d55600:00000000 [DeckLink Duo (1)]
81:84d55601:00000000 [DeckLink Duo (2)]
81:84d55602:00000000 [DeckLink Duo (3)]
81:84d55603:00000000 [DeckLink Duo (4)]
List supported formats for a device
ffmpeg -f decklink -list_formats 1 -i ‘ DeckLink Duo (4) ‘
Display Decklink input on screen
ffplay -f decklink -i ” DeckLink Duo (1) “
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)
- Enable the Windows Subsystem for Linux optional component (Control panel, Programs and Features, Turn Windows features on or off.)
- Go to the Windows Store app and search for Ubuntu and install 20.04 LTS version.
- Start Ubuntu from Windows command the type the following commands (some will take a long time)
- sudo apt-get update
- sudo bash -c ‘echo 0 > /proc/sys/fs/binfmt_misc/WSLInterop’
- sudo apt-get install subversion ragel curl texinfo g++ bison flex cvs yasm automake libtool autoconf gcc cmake git make pkg-config zlib1g-dev unzip pax nasm gperf autogen bzip2 autoconf-archive p7zip-full meson clang python3-distutils python-is-python3 -y
(if you get a warning about other required software when you run the .sh file below, just copy the command and run it) - mkdir ffmpeg
- cd ffmpeg
- git clone https://github.com/rdp/ffmpeg-windows-build-helpers.git
- cd ffmpeg-windows-build-helpers
- sudo ./cross_compile_ffmpeg.sh –disable-nonfree=n
(note: there are two dashes in front of the disable-nonfree parameter. Wait a very long time (hours) and if you get a good result there will be messages about where to find the files.
If you get an error about libsvtvp9 not found, edit the .sh file and change line 2340 to comment out
config_options+=” –enable-libsvtvp9″
You can now use Windows Explorer and put the following in the address bar
\wsl.localhost\Ubuntu-20.04\home\[your user name]\ffmpeg-windows-build-helpers\sandbox\cross_compilers\mingw-w64-i686\i686-w64-mingw32\bin
Copy the requires .exe file to your windows location of choice
[…] Note: below is now out of date. I have published a new article on how to compile your own copy of FFMPEG for windows that works with autodetection of the input signal. See Ffmpeg with Decklink support for Windows […]
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
peg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-x86_64/bin/x86_64-w6
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
/ffmpeg/ffmpeg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-x86_64/x8
6_64-w64-mingw32
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
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.
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
Yes, copy/paste turned the – – into a long – (if you look closely you can see the difference. Thanks for pointing it out.
i tried, but get an Error:
your meson version is too old 0.45.1 wanted 0.47
Try this command
pip install meson==0.47 –upgrade
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) ||
^~~~~~~~~~~~~~~~~~~~~~~
FS_FILE_ENCRYPTION
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….
There was a reply in issues section of ffmpeg-windows-build-helpers
https://github.com/rdp/ffmpeg-windows-build-helpers/issues/421
The reply was “looks like a bump of libsrt version worked, thanks for the report”.
How to go about this?
If you had run the Git command prior to the latest update 2 days ago, just run Git Fetch.
I’ll try it in the next couple of days.
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
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/
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,
Valentin
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’
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?
I’m also stuck on this. Will try and sort it out.
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)
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/”
Me too! I followed the instructions very thoroughly, but got the same result on 2 different PCs.
No ffmpeg binary.
Used the Windows 10 Linux Subsystem approach with Ubuntu 20.04
😦
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
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!
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!
Noam.
Hi All,
I’ve been attempting to build using this guide for a few days, but I seem to always run into the following error:
https://prnt.sc/s9wlrw
Has anyone got a work around?
Thank you all for contributing!
I had to fix reference to mutex at hrafbuzz . I have merged manually this fix :
https://github.com/rdp/ffmpeg-windows-build-helpers/commit/0fef12b450127d9f2e9bf6aa629559fcf3b97fae
according to:
https://github.com/rdp/ffmpeg-windows-build-helpers/issues/389
I don’t know why they don’t have it on latest
This finished the build for me! I will test the decklink in the morning! You sir are a god send! Thank you!
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?
Did you check it is in the supported devices?
How would one check? I managed to get it outputting, but it is blank
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.
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
Hi Ian, how can we update the FFMPEG code to the latest 4.x? when did they branch this out/which version?
Thank you!
Got the below error when trying to clone https://github.com/rdp/ffmpeg-windows-build-helpers
git clone https://gitub.com/rdp/ffmpeg-windows-build-helpers.git
Cloning into ‘ffmpeg-windows-build-helpers’…
fatal: unable to update url base from redirection:
asked for: https://gitub.com/rdp/ffmpeg-windows-build-helpers.git/info/refs?service=git-upload-pack
redirect: http://www6.gitub.com/?template=simple2c&tdfs=1&s_token=1626703484.0017741114&uuid=1626703484.0017741114&term=Software%20Developer%20Platform&term=Online%20Collaboration%20Project%20Management&term=Open%20Source%20Low%20Code%20Platform&term=Billing%20And%20Subscription%20Management&searchbox=0&showDomain=0&backfill=0
I noticed typo in my git clone command above. Ignore the comment.
However, the executables were not compiled
Is anyone getting the Windows executables to compile using current instructions? The process aborts after a couple of hours for me, although I did manage to compile them a year and a while ago using earlier instructions.
Failed with the message below when processing openjpeg_git:
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/CheckTypeSize.cmake:246 (__check_type_size_impl)
/usr/share/cmake-3.16/Modules/TestBigEndian.cmake:45 (CHECK_TYPE_SIZE)
CMakeLists.txt:167 (TEST_BIG_ENDIAN)
CMake Error at /usr/share/cmake-3.16/Modules/TestBigEndian.cmake:50 (message):
no suitable type found
Call Stack (most recent call first):
CMakeLists.txt:167 (TEST_BIG_ENDIAN)
— Configuring incomplete, errors occurred!
Could someone upload to anywhere a ffmpeg with decklink for win?
Look in the ffmpeg folder here https://onedrive.live.com/redir.aspx?cid=62b84429c3a8a991&resid=62B84429C3A8A991!180019&parId=62B84429C3A8A991!244&authkey=!ALAQwqvmWOJM8BM
No support for it sorry.