一.下載ffmpeg的32位的dev和share文件 把裏面的include,lib,*.dll文件拷貝到項目底下;
二.集成include和lib到項目裏面
1.集成include 右鍵項目:屬性-》c/c++ 常規-》附加包含目錄:
2.集成lib 右鍵項目:屬性-》鏈接器 常規-》附加庫目錄:
三 創建頭文件
extern "C"
{
#include"include/libavcodec/avcodec.h"
#include"include/libavformat/avformat.h"
}
四. 運行項目
1 . error C4996: 'av_register_all': 被聲明爲已否決
2.error LNK2019: 無法解析的外部符號 _avformat_alloc_context,該符號在函數 _main 中被引用
添加的庫爲:avcodec.lib; avformat.lib; avutil.lib; avdevice.lib; avfilter.lib;postproc.lib;swresample.lib; swscale.lib