Compile ffmpeg libs on Windows with Visual Studio compiler
CommentsToday I spent some time to compile ffmpeg
libs on Windows. Most documentation out there is not updated to 2015, yet compiling ffmpeg
on Windows is pretty easy. If you’re looking for a copy and paste solution, keep reading.
Pre-requisites
- Visual Studio 2013 or 2015
- MSYS2
- YASM
Visual Studio
Latest ffmpeg
versions compile both with Visual Studio 2013 and 2015. Previous versions don’t compile with VS2015 because they expect that VS compiler has no snprintf
support while it was introduced in VS2015.
MSYS2
- Download and run the installer at http://msys2.github.io. Follow the instructions and install it in
C:\workspace\windows\msys64
- Install required tools:
pacman -S make gcc diffutils
- Rename
C:\workspace\windows\msys64\usr\bin\link.exe
toC:\workspace\windows\msys64\usr\bin\link_orig.exe
, in order to use MSVClink.exe
(naming conflict)
YASM
- Download Win64.exe and move it to
C:\workspace\windows
- Rename
yasm-<version>-win64.exe
toyasm.exe
- Add
C:\workspace\windows
to PATH environment variable (setx PATH "%PATH%;C:\workspace\windows
)
Ready to compile
Launch msys2 shell from Visual Studio Code shell
- Run VS2013 prompt
- Run
C:\workspace\windows\msys64\msys_shell.bat
: will open msys2 shell inheriting%PATH%
from VS2013 prompt - Ensure
which cl
exists andwhich link
points to MSVC cd /c/path/to/ffmpeg
./configure
andmake
Basic configure
switches:
Upcoming conferences
I will join the following conferences. Reach me out on Twitter if you
wanna meet:
Incontro DevOps 2020 | Virtual | 22 October 2020 |
---|