这里记录一下windows11配置ffmpeg-next环境的步骤。

  • 配置tauri2.0的环境,参考tauri2.0文档

    • 上述过程中依次安装了Microsoft C++ Build Tools, WebView2, Rust, Node。注意其中的rust就用官网的exe安装即可,如果系统没有梯子,安装会比较慢。以及确保使用msvc工具链构建的rust,不是gnu工具链构建的。
  • 按照这个ffmpeg-next环境配置指南中的说明进行配置。

    • MSVC toolchain
      • Install LLVM (through official installer, Visual Studio, Chocolatey, or any other means), 这里建议直接用Visual Studio Installer安装,因为它在上面Microsoft C++ Build Tools安装时已经装过了,只需要重新打开它,安装"单个组件"-搜索clang的两个结果即可。
      • set LIBCLANG_PATH to PATH(非常重要!)
      • Install FFmpeg (complete with headers) through any means, e.g. downloading a pre-built "full_build-shared" version from https://ffmpeg.org/download.html.
      • Set FFMPEG_DIR to the directory containing include and lib.
      • Add FFmpeg's bin path to PATH.
  • 实在不行,可以参考这个官方构建yml文件,找到对应系统的配置照做即可:https://github.com/zmwangx/rust-ffmpeg/blob/master/.github/workflows/build.yml.

请注意,如果所有步骤都做完还是报错,立即重启电脑试试。 不要用pacman去安装什么msys2/pkg-config/vcpkg之类的东西。

标签: tauri, rust, ffmpeg, ffmpeg-next

添加新评论

0%