win10x64企業(yè)版。vs2015update3企業(yè)版。git(git version 2.10.0.windows.1)。
http://msys2.github.io msys2-x86_64-20161025.exe
http://msys2.github.io. 選擇第二個:msys2-x86_64-20161025.exe 下載后,安裝默認安裝到C:/msys64。 msys2-x86_64-20161025.exe的下載可能比較慢,中途可能斷掉,建議使用Firefox下載,或者使用支持斷點續(xù)傳的工具下載。
安裝后,到msys2窗口執(zhí)行,安裝編譯程序:
pacman -S make gcc diffutils pkg-config# 可能需要多嘗試幾次,我安裝的時候gcc更新了幾次才成功,這個更新過程支持斷點續(xù)傳。# 如果不按照pkg-config,運行./configure的時候,會出現(xiàn)如下warning# WARNING: pkg-config not found, library detection may fail.重命名C:/msys64/usr/bin/link.exe 為C:/msys64/usr/bin/link.bak, 避免和MSVC 的link.exe抵觸。
YASM下載地址:http://yasm.tortall.net/Download.html,下載其64位版本W(wǎng)in64 .exe (64 位 Windows 通用)。 下載后,將下載回來的yasm-1.3.0-win64.exe 改名為yasm.exe,并放置于 MSYS2 安裝目錄中。就是放置到c:/msys64/usr/bin/ 中。
在命令提示符窗口輸入:
# 切換到c:/msys64目錄cd c:/msys64# 切換vs2016 64位環(huán)境C:/PRogram Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/vcvars64.bat#打開msys2的mingw64窗口msys2_shell.cmd -mingw64在窗口上右擊鼠標,選擇[Options]菜單,選擇[Text],locale選擇:zh_CN,Character set 選擇 GBK。
這樣以后,編譯生產(chǎn)的執(zhí)行文件ffmpeg.exe和DLL文件在目錄C:/msys64/usr/local/bin中,開發(fā)頭文件在C:/msys64/usr/local/include中。
下載SDL2-2.0.5.tar.gz版本,并編譯 http://www.libsdl.org/download-2.0.php http://www.libsdl.org/release/SDL2-2.0.5.tar.gz
tar -zxvf SDL2-2.0.5.tar.gzcd SDL2-2.0.5./configure --prefix=/d/git/ffmpeg/buildmakemake install下載x264,并編譯
git clone http://git.videolan.org/git/x264.gitgit checkout -b stable remotes/origin/stable./configure --prefix=/d/git/ffmpeg/build --host=x86_64-w64-mingw32 --enable-sharedmakemake install編譯帶ffplay.exe的ffmpeg
export PKG_CONFIG_PATH=/d/git/ffmpeg/build/lib/pkgconfig/# 如果不正確設(shè)置PKG_CONFIG_PATH環(huán)境變量,帶ffplay的ffmpeg ./configure 時,會出現(xiàn)Warning# WARNING: using libx264 without pkg-config./configure --prefix=/d/git/ffmpeg/build --enable-libx264 --enable-shared --enable-static --arch=x86 --extra-cflags='-I/d/git/ffmpeg/build/include -I/d/git/ffmpeg/build/include/SDL' --extra-ldflags='-L/d/git/ffmpeg/build/lib' --enable-yasm --enable-asm --enable-version3 --enable-gpl --enable-memalign-hack --enable-ffplaymake make install
|
新聞熱點
疑難解答