Running ffmpeg from Docker on Windows
Hi!
I've been trying to run ffmpeg from Docker on Windows, do you know if this is possible?
I'm getting an exitcode 3221225781, which is microsoft slang for "missing dependencies". Can you tell me something about the environment requirements for ffmpeg.exe ?
Something else I noticed when calling the .exe: nothing happens..
PS K:\src> C:\Users\ContainerAdministrator\AppData\Local\cypress\Cache\9.1.1\Cypress\resources\app\node_modules\@ffmpeg-installer\win32-x64\ffmpeg.exe
PS K:\src>
But when executing the same binary outside of Docker I'm getting the familiar output
PS C:\ffmpeg .\ffmpeg.exe
ffmpeg version 2021-12-09-git-b9f4c1231f-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 11.2.0 (Rev2, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig
[.. a lot more here ..]
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
Use -h to get full help or, even better, run 'man ffmpeg'
PS C:\ffmpeg
Better late than never... I did a bit of checking using https://stefanscherer.github.io/find-dependencies-in-windows-containers/, and it turns out that both the 'essentials' build (https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-essentials.7z) and the 'full' build (https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-full.7z) need two additional DLLs from \Windows\System32 to be able to run:
avicap32.dllmsvfw32.dll
I'm guessing that this is because --enable-avisynth is on, or maybe it is another library that pulls in these particular DLLs. Maybe @GyanD has more information.
In any case, it looks like at least the Windows "servercore" images do not contain these DLLs in their System32 directory, so you have to place them side-by-side with Gyan's executables.
I could successfully start ffmpeg.exe, ffplay.exe (though this won't be useful in a container) and ffprobe.exe from the following Dockerfile:
FROM mcr.microsoft.com/windows/servercore:ltsc2016-amd64
WORKDIR /ffmpeg
#COPY ffmpeg-6.0-essentials_build/bin/ff*.exe ./
COPY ffmpeg-2023-03-05-git-912ac82a3c-full_build/bin/ff*.exe ./
COPY avicap32.dll msvfw32.dll ./
(You have to manually copy the two DLLs from your System32 directory to the build dir, because Docker refuses to copy files from outside that directory.)
Yes, Avisynth seems to be the only relevant lib that depends on LoadLibrary.