Windows下编译obs,官方提供了两种方式,这里我们选用cmake来编译
一、使用cmake编译obs (1)编译准备环境- Visual Studio 2019 (recommended)
- Windows 10 SDK (minimum 10.0.20348.0). Latest SDK
- Development packages of FFmpeg, x264, cURL, and mbedTLS
- Pre-built Windows dependencies for Visual Studio 2019 can be found in the obs-deps repo releases
- Qt 5.15.2 (Grab the MSVC package for your version of Visual Studio)
- CEF Wrapper (x64, x86)
- Windows version of CMake (3.20 or higher, latest preferred)
- Windows version of Git (Git binaries must exist in path)
- 克隆源代码 git clone --recursive https://github.com/obsproject/obs-studio.git
- 打开cmake 配置环境变量
- DepsPath:D:/sourcecode/obs/windows-deps-2022-07-18-x64
- QTDIR64:C:/Qt/5.15.2/msvc2019_64
- CEF_ROOT_DIR:D:/sourcecode/obs/cef_binary_4638_windows_x64
- 点击 Configure 然后点击 Generate 生成解决方案
- 设置可执行项目为启动项
- vs安装qt插件
- 配置qt插件的qmake路径
提示编码错误
解决方法:右键报错的项目->属性->C/C+±>所有选项->附加选项 中添加 /utf-8
最后再次编译
注意:vs2019调试运行之前还得设置可执行程序路径和工作目录,否则调试启动失败



