当前位置: 首页 > news >正文

2025最新obs31.0.x版本编译办法,windows系统

截止到2025年5月份的obs最新版本是obs 31.0.3,最近又需要用到它,编译起来跟过去方法差别比较大。
一开始尝试用visual studio 2019版本编译,有900多个错误,全都是依赖库的编译错误。从网上查到这些依赖库现在都是基于visual sutio 2022编译的,要想用vs2019编译obs项目,需要将这些依赖库全都用vs2019重新编译过,太麻烦啦。还是用官方推荐的visual studio 2022来编译。只遇到一个困惑让人无从下手的问题。


1.1 下载源码
git clone --recursive https://github.com/obsproject/obs-studio.git

cd obs-studio 
git submodule update --init --recursive  
git checkout --track origin/release/31.0

1.2 安装依赖
安装PowerShell 7.5.1,以管理员身份运行powershell
找到Build-Windows.ps1 文件所在目录
obs-studio\.github\scripts\Build-Windows.ps1
cd 到Build-Windows.ps1 文件所在目录
执行./Build-Windows.ps1
【报错:
  throw "Build-Windows.ps1 requires CI environment"
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Build-Windows.ps1 requires CI environment
】     

PS D:\develop\obs-studio\.github\scripts> Set-ExecutionPolicy Unrestricted
PS D:\develop\obs-studio\.github\scripts> Get-ExecutionPolicy

只需在命令行执行$env:CI = "true"
PS D:\develop\obs-studio\.github\scripts> $env:CI = "true"
PS D:\develop\obs-studio\.github\scripts> .\Build-Windows.ps1

PS D:\develop\obs-studio\.github\scripts> Set-ExecutionPolicy Unrestricted
PS D:\develop\obs-studio\.github\scripts> .\Build-Windows.ps1
Exception: D:\develop\obs-studio\.github\scripts\Build-Windows.ps1:17
Line |
  17 |      throw "Build-Windows.ps1 requires CI environment"
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Build-Windows.ps1 requires CI environment
PS D:\develop\obs-studio\.github\scripts> Get-ExecutionPolicy
Unrestricted
PS D:\develop\obs-studio\.github\scripts> .\Build-Windows.ps1
Exception: D:\develop\obs-studio\.github\scripts\Build-Windows.ps1:17
Line |
  17 |      throw "Build-Windows.ps1 requires CI environment"
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Build-Windows.ps1 requires CI environment
PS D:\develop\obs-studio\.github\scripts> $env:CI = "true"     #之前不清楚需要设置,一直报错
PS D:\develop\obs-studio\.github\scripts> .\Build-Windows.ps1   #到这里就能执行成功啦

powershell执行.\Build-Windows.ps1,生成的项目在这两个新建的目录下
obs-studio/build_x64/
obs-studio/build_x86/

1.3 配置编译工程
不需要再用cmake来生成.sln项目文件
直接用visual studio 2022打开obs-studio/build_x64/obs-studio.sln
编译x64的debug或release都能编译过,
打开obs的【设置】->【直播】,自定义rtmp推流地址,开始直播,即推流成功。

1.4 windows系统打包工具可以用Inno Setup Compiler
  不做赘述

相关文章:

  • 数据湖和数据仓库的区别
  • ES的倒排索引和正排索引的区别及适用场景?为什么倒排索引适合全文搜索?
  • vue3 threejs 物体发光描边
  • 电力设备制造企业数字化转型路径研究:从生产优化到生态重构
  • WordPress_Madara 本地文件包含漏洞复现(CVE-2025-4524)
  • k8s-ServiceAccount 配置
  • GPT 等decoder系列常见的下游任务
  • Vite + Vue 工程中,为什么需要关注 `postcss.config.ts`?
  • CSS、SCSS 和 SASS 的语法差异
  • CSS【详解】弹性布局 flex
  • 【基础】Windows开发设置入门9:WSL 2 上的 Docker 容器
  • CSS 链接样式全解析:从基础状态到高级交互效果
  • 【css】 flex布局基本知识
  • 多通道经颅直流电刺激器产品及解决方案特色解析
  • SuperVINS:应对挑战性成像条件的实时视觉-惯性SLAM框架【全流程配置与测试!!!】【2025最新版!!!!】
  • DS18B20 温度传感器实验探索与实践分享​
  • Backwards对自动路由的影响
  • 提示词工程(Prompt Engineering)是智能Agent交互中不可或缺的一环
  • 微型化GNSS射频前端芯片AT2659S:L1频段多系统支持,SOT23-6封装
  • [实战]用户系统-1-基础功能完善
  • 常山网站建设/中国网站排名前100
  • 网站推广营销联系方式/淘宝指数查询官网
  • 外贸官网建设/谷歌seo快速排名软件首页
  • 外贸建站 台州/企业整站推广
  • 帮客户做网站平台犯法吗/百度云网盘网页版
  • 网站建设放入什么会计科目/站长网站大全