本地环境
qt6.5.3 系统版本:14.5
一、简介
Shotcut是一个开源的跨平台的视频编辑软件,支持WIN/MACOS/LINUX等平台
官方编译文档地址:
Shotcut - How To Use the macOS SDK
二、源码编译
1.源码下载
github代码不完整,建议从官网编译文档下载
解压shotcut-macos-sdk-230929.txz文件(内部包含源码与库文件)
2.修改pc文件
修改mlt++-7.pc和mlt-framework-7.pc文件
mlt++-7.pc文件位置:源码路径/src/mlt/src/
mlt-framework-7.pc文件位置:源码路径/src/mlt/src/framework
prefix=/Users/changran/openSource/video-cut/Shotcut //Users/changran/openSource/video-cut/是我的代码路径
exec_prefix=${prefix}/build
libdir=${prefix}/Contents/Frameworks
includedir=${prefix}/Contents/Frameworks/include
datadir=${prefix}build/share
Name: mlt++
Description: C++ API for MLT multimedia framework
Version: 7.19.0
Requires: mlt-framework-7
Libs: -L${libdir} -lmlt++-7
Cflags: -I${includedir}/mlt-7/mlt++
prefix=/Users/changran/openSource/video-cut/Shotcut
exec_prefix=${prefix}/build
libdir=${prefix}/Contents/Frameworks
includedir=${prefix}/Contents/Frameworks/include
datadir=${prefix}/build/share
moduledir=${prefix}/lib/mlt
mltdatadir=${datadir}/mlt
Name: mlt-framework
Description: MLT multimedia framework
Version: 7.19.0
Requires:
Libs: -L${libdir} -lmlt-7
Cflags: -I${includedir}/mlt-7
3.建立软连接
4.qtCreator增加环境环境变量
PKG_CONFIG_PATH=/Users/changran/openSource/video-cut/Shotcut/Contents/Frameworks/lib/pkgconfig
PATH=/Users/changran/openSource/video-cut/Shotcut/Contents/MacOS
5.执行cmake报错找不到fftw
5.1 brew install fftw
brew info fftw
5.2 拷贝fftw头文件和库文件
5.2.1 拷贝头文件
新建文件夹fftw,将/opt/homebrew/Cellar/fftw/3.3.10_1/include/下文件拷贝到
/Users/changran/openSource/video-cut/Shotcut/Contents/Frameworks/include/fftw
5.2.2拷贝库文件
cp /opt/homebrew/Cellar/fftw/3.3.10_1/lib/libfftw3.3.dylib /Users/changran/openSource/video-cut/Shotcut/Contents/Frameworks/
6.修改构建配置文件
-DCMAKE_INSTALL_PREFIX=/Users/changran/openSource/video-cut/ -DCMAKE_INSTALL_RPATH=@executable_path/../Frameworks -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON
7.修改运行配置
修改步骤
- 点击运行,修改运行配置
- 点击添加增加自定义运行配置
- 运行文件设置
- qt相关设置
执行文件地址:/Users/changran/openSource/video-cut/Shotcut/Contents/MacOS/Shotcut
qt相关设置
QT_PLUGIN_PATH=/Users/changran/Qt/6.5.3/macos/plugins;
QML2_IMPORT_PATH=/Users/changran/Qt/6.5.3/macos/qml;