音视频开源项目shotcut源码编译

该文详细介绍了如何安装msys2和必需的库,使用QtCreator配置Shotcut项目,设置环境变量,调整CMake设置进行构建。此外,还涉及到了Shotcut依赖项的重建过程,包括设置路径、编译选项以及解决Qt平台插件问题。对于命令行调试和可能出现的错误处理也给出了指导。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

(0)工具安装

  • 安装 msys2

  • 安装 fftw

    pacman -S mingw-w64-x86_64-fftw

  • 安装 pkg-config

    pacman -S mingw-w64-x86_64-pkg-config

(1)使用sdk 官网文档

  1. Download and install the following:
  1. Extract the Shotcut SDK .zip file to a new folder in C:\ named “Projects” (C:\Projects).
  2. In Qt Creator open C:\Projects\Shotcut\src\shotcut\CMakeLists.txt.
  3. In the Configure Project screen, select your previously configured Kit and click Configure Project: image.png
  4. Click Projects in the navigation bar on the left side of the Qt Creator window.
  • In the left column of the Shotcut project configuration click Build to show the Build Settings:
  • In Build Environment add environment variable PKG_CONFIG_PATH and set it to C:\Projects\Shotcut\lib\pkgconfig.
  • Prepend msys2 binary folders to environment variable Path: C:\msys64\usr\local\bin;C:\msys64\mingw64\bin;
  • In CMake > Current Configuration find CMAKE INSTALL_PREFIX and change its value to C:\Projects\Shotcut and click Run CMake.
  1. In the left column of the Shotcut project configuration click Run to show the Run Settings: image.png
  • In Run click Add… > Custom Executable;
    in Executable: enter “C:\Projects\Shotcut\shotcut.exe”: image.png
  1. After clicking Run (the green play button in bottom left of Qt Creator), you can confirm the newly built executable is the one that is running from the Help > About Shotcut… dialog: the version will be “adhoc”.

(2)Final Project

project.pngfinal.png

(3)Rebuilding Dependencies

The section above just gets you a working environment for the Shotcut code, but not any of its dependencies. Some of the dependencies included in the SDK with source code can be opened and used within Qt Creator - e.g., frei0r. Instructions for that are not yet included. In other cases you can use the Git Bash shell environment. Upon opening a Git Bash shell, enter (or add to ~/.profile and restart the shell):

export PATH="/c/Qt/x86_64-5.4.0-release-posix-seh-rt_v5-rev0/mingw64/bin:$PATH"
export QTDIR="c:/Qt/qt-5.9.7-x64-mingw540-seh"
export CC=gcc
export CXX=g++
export PKG_CONFIG_PATH="c:/Projects/Shotcut/lib/pkgconfig"
export CFLAGS="-Ic:/Projects/Shotcut/include -DHAVE_STRUCT_TIMESPEC"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="-Lc:/Projects/Shotcut/lib -Lc:/Projects/Shotcut"
alias make=mingw32-make

For a project’s configure step, often you can supply the prefix as /c/Projects/Shotcut and make install will work as expected. However, sometimes you need to copy DLLs from bin/ or lib/ into /c/Projects/Shotcut where shotcut.exe resides.

When working with git repos from the SDK on Windows, it may helpful to issue git config core.fileMode false to prevent unchanged files from appearing in git status and git diff.

(4)Command Line Debugging

When using gdb at the command line to debug, using Ctrl+C to break execution will also exit the debugger. There is a program called breakgdb.exe (source) that can be used to break execution.

(5)cmake 配置截图

image.png

(6)运行报错解决方法

报错:Qt This application failed to start because no Qt platform plugin could be initialized
解决:将Qt目录下plugin文件夹中的platforms文件夹直接复制到项目.exe的运行目录下
image.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值