2、編譯過程html
一、編輯C:\MinGW\msys\1.0\msys.bat文件,在最前面加入一行linux
後面路徑是機器上安裝的vc的對應路徑,加入這行編譯ffmpeg時會多出windows下調用dll對應的lib,方便vc調用。(網上看到的)windows
二、雙擊C:\MinGW\msys\1.0\msys.bat運行,進入ffmpeg源碼目錄D:\ffmpeg0.8.5,這個窗口的命令和shell類似,和cmd運行有些區別,右斜槓須要換成左斜槓,而後盤符D:也要改爲/d,輸入cd /d/ffmpeg/ffmpeg0.8.5,進入ffmpeg主目錄。服務器
三、開始編譯ffmpeg,繼續輸入:ide
4,等待一段時間後,輸入:make (忽略警告)函數
5,等待較長的時間後,輸入make installui
這樣就能夠調用ffmpeg庫了。
附:編譯時遇到的一些問題:
1,Cannot open include file: 'inttypes.h': No such file or director解決辦法
一、找到include目錄中的ffmpeg\common.h
二、在「#define COMMON_H」以後加入以下代碼,同時刪除「#include <inttypes.h>」 而後保存:
#if defined(WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__)
#
#endif
#if defined(WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__) && !defined(EMULATE_INTTYPES)
#
#endif
#ifndef EMULATE_INTTYPES
#
#else
#
#
#
#endif
2,error C3861: 'UINT64_C': identifier not found
找到include目錄中的ffmpeg\common.h
在函數頭部加入宏定義:
//本身所加的定義,處理UINT64_C未定義的錯誤
#ifndef INT64_C
#define INT64_C(c) (c ## L)
#define UINT64_C(c) (c ## UL)
#endif
3,處理相關宏定義格式錯誤,將括號中的…改成n
#if AV_GCC_VERSION_AT_LEAST(4,3)
#else
#endif
4,出現Cannot open include file: 'stdint.h': No such file or directory
在出現 #include <stdint.h>的地方注掉便可
5,處理template類錯誤的方法,在extern前檢查宏定義
#undef __cplusplus
extern "C" {
#include "libavutil/avutil.h"
#include "libavformat/avformat.h"
}
#define __cplusplus