How to build ffmpeg?

출처: http://ffmpeg.org/platform.html#Windows

4.1.1 Native Windows compilation using MSYS2

The MSYS2 MinGW-w64 environment provides ready to use toolchains and dependencies through pacman.

Make sure to use mingw64_shell.bat or mingw32_shell.bat to have the correct MinGW-w64 environment. The default install provides shortcuts to them under MinGW-w64 Win64 Shell and MinGW-w64 Win32 Shell.

normal msys2 packages

pacman -S make pkgconf diffutils

mingw-w64 packages and toolchains

pacman -S mingw-w64-x86_64-yasm mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL

To target 32 bits replace x86_64 with i686 in the command above.

# normal msys2 packages
pacman -S make pkgconf diffutils

# mingw-w64 packages and toolchains
pacman -S mingw-w64-x86_64-yasm mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL
C:\msys64\mingw64\x86_64-w64-mingw32\bin;C:\msys64\mingw64\bin;

or

C:\msys64\mingw32\i686-w64-mingw32\bin;C:\msys64\mingw32\bin;

-            cross_prefix=x86_64-w64-mingw32-
+            cross_prefix=