Intel QSV下載編譯
git clone https://github.com/lu-zero/mfx_dispatch.git
1.使用CMake生產VS工程
編譯生成libmfx.lib文件
頭文件為mfx文件夾
libmfx---include---mfx---lib---libmfx.lib
Webrtc中ffmpeg的修改
因為Webrtc中的ffmpeg是使用gn進行編譯的,所以這里先找到對應目錄
https://chromium.googlesource.com/chromium/third_party/ffmpeg.git
1、添加庫
在FFMPEG路徑下添加新文件夾3rd,并把上面打包的libmfx拷貝進入
2.
修改FFMPEG配置
BUILD.gn
//在include_dirs里面,多少行不記得了,你自己找一下
"3rd/libmfx/include/mfx"
config.h---目錄為chromium\config\Chromelwin\x64\config.h
#define CONFIG_LIBMFX 1
#define CONFIG_D3D11VA 1
#define CONFIG_HWACCELS 1
#define CONFIG_QSV 1
#define CONFIG_QSVDEC 1
#define CONFIG_QSVVPP 1
config_components.h---目錄為chromiumlconfig\Chromelwin\x64\config_components.h
#define CONFIG_H264_QSV_DECODER 1
#define CONFIG_H264_D3D11VA_HWACCEL 1
#define CONFIG_H264_D3D11VA2_HWACCEL 1
bsf_list.c--目錄為chromium\config\Chromelwin\x64\libavcodec\bsf_list.c添加
&ff_h264_mp4toannexb_bsf,
ffmpeg_generated.gni加入
if(is_win){ffmpeg_c_sources += ["libavcodec/qsv.c","libavcodec/qsvdec.c","libavcodec/dxva2.c","libavcodec/dxva2_h264.c","libavcodec/h264_mp4toannexb_bsf.c","libavfilter/qsvvpp.c","libavfilter/vf_vpp_qsv.c","libavutil/hwcontext_qsv.c","libavutil/hwcontext_dxva2.c","libavutil/hwcontext_d3d11va.c",]
}
webrtc重新生成工程,編譯即可
如果遇到編譯錯誤:修改#include<mfxvideo.h>為#include"3rd/libmfx/include/mfx/mfxvideo.h
注意:這里的3rd是自己上面自己創建的目錄,根據你創建的來,這里只是給一個示范