Olive Master 编译指南

以下是编译 Olive 视频编辑器的详细步骤,适用于 Windows 环境(以 Visual Studio 2022 为例)。Olive 是一个基于 Qt 和 FFmpeg 的开源非线性视频编辑器。

1. 环境准备

确保安装以下工具和依赖:

  • Qt 5.15+:推荐使用 5.15 版本。

  • Visual Studio 2022:安装时选择 C++ 开发工具。

  • vcpkg:用于管理和安装依赖库。

  • CMake:Visual Studio 通常自带。

2. 安装依赖

使用 vcpkg 安装依赖

  • 克隆 vcpkg 仓库并初始化:

git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
/bootstrap-vcpkg.bat
  • 创建 vcpkg.json 文件,指定依赖项和版本:

{
"dependencies": [
"ffmpeg",
"openimageio",
"opencolorio",
"portaudio"
],
"builtin-baseline": "3426db05b996481ca31e95fff3734cf23e0f51bc"
}
  • 安装依赖:

vcpkg install --triplet x64-windows-release
---------------------------

如果报错

PS D:\剪辑\olive\vcpkg> .\vcpkg.exe install --triplet x64-windows-release
Detecting compiler hash for triplet x64-windows-release...
error: while detecting compiler information:
The log file content at "D:\剪辑\olive\vcpkg\buildtrees\detect_compiler\stdout-x64-windows-release.log" is:
-- Found ninja('1.11.0') but at least version 1.13.1 is required! Trying to use internal version if possible!
CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:136 (message):
  Download failed, halting portfile.

报错含义
vcpkg 在配置阶段会调用 ninja -v 来验证生成器是否可用。你机器里先被找到了 1.11.0(系统 PATH 或 VS 自带),但当前 port 要求 ≥ 1.13.1,于是 vcpkg 中止并提示 Found ninja('1.11.0') but at least version 1.13.1 is required!
根本原因不是 Olive 本身,而是 vcpkg 强制使用自己下载的 ninja,但缓存里版本太旧;或者 VS 自带的 ninja 优先级更高,把 vcpkg 的版本覆盖了

    1. 让 vcpkg 重新下载最新 ninja
      外网机 执行一次(内网机也可手动拷):
      powershell
      复制
      
      vcpkg fetch ninja
       
      完成后能看到
      .../downloads/tools/ninja/1.13.1-windows/ninja.exe

--------------

目录要没有中文

下载失败要用镜像

一、设置“资源包”镜像(tar.gz、patch、工具链)

  1. Win + R → 输入 sysdm.cpl环境变量
  2. 新建系统变量
表格
复制
变量名变量值(二选一)
X_VCPKG_ASSET_SOURCES x-azurl,http://mirrors.ustc.edu.cn/vcpkg-assets/
x-azurl,https://mirrors.tuna.tsinghua.edu.cn/vcpkg-assets/

 

--------------

 

3. 下载源码

  • 克隆 Olive 源码:

git clone https://github.com/olive-editor/olive.git
  • 下载外部子模块(如 core 和 KD)到指定目录:

git submodule update --init --recursive

4. 配置和编译

  • 使用 Visual Studio 打开 Olive 根目录下的 CMake 项目。

  • 设置为 Release 模式,并确保 CMake 成功加载所有依赖。

  • 在 CMakeLists.txt 中添加 UTF 编译选项以避免错误:

add_compile_options(/utf-8)
  • 点击“生成 > 全部生成”,等待编译完成。

5. 运行程序

编译完成后,直接运行生成的可执行文件即可启动 Olive。

注意事项

  • 使用 FFmpeg 4.x 或 5.x 版本,避免因 API 不兼容导致编译失败。

  • 如果不想手动安装依赖,可下载预编译的依赖包并配置环境变量。

通过以上步骤,您可以成功编译 Olive 视频编辑器并开始使用!

posted @ 2025-10-19 09:18  cnchengv  阅读(5)  评论(0)    收藏  举报