Skip to content

Getting Started

johnjiamzhong-project edited this page Jun 6, 2026 · 1 revision

Getting Started

环境要求

项目 版本 / 路径
操作系统 Windows 10/11 x64
IDE VSCode + CMake Tools 扩展
编译器 MSVC 2017 x64(Visual Studio 15 2017)
Qt 5.14.2(E:\Qt\Qt5.14.2\5.14.2\msvc2017_64
FFmpeg vcpkg 安装,toolchain D:\vcpkg\scripts\buildsystems\vcpkg.cmake
CMake 3.16+

构建步骤

1. 首次配置(或修改 CMakeLists.txt 后)

cmake --preset default

2. 编译 Debug

cmake --build build --config Debug

3. 编译 Release

cmake --build build --config Release

---
运行

编译完成后直接运行:

build/Debug/RambosPlayer.exe

或 Release 版本:

build/Release/RambosPlayer.exe

---
运行单元测试

# 运行全部测试
ctest --test-dir build --config Debug --output-on-failure

# 单独运行指定测试
.\build\Debug\TstFrameQueue.exe
.\build\Debug\TstAVSync.exe
.\build\Debug\TstDemuxThread.exe

▎ TstDemuxThread 依赖 tests/data/sample.mp4,首次运行前需生成:
▎
▎ ffmpeg -f lavfi -i "testsrc=duration=2:size=320x240:rate=25" \
▎        -f lavfi -i "sine=frequency=440:duration=2" \
▎        -c:v libx264 -c:a aac -shortest tests/data/sample.mp4

---
打包发布

Release 编译完成后运行打包脚本:

cd release
.\package.ps1                    # 默认版本 1.0.0
.\package.ps1 -Version "1.2.1"  # 指定版本号

输出:
- release/dist/ — 展开目录,可直接运行验证
- release/RambosPlayer-v1.2.1.zip — 最终分发包

脚本自动收集 Qt 运行时 DLL(windeployqt)、FFmpeg DLL、libx264、mpegts.min.js 等依赖。

---
崩溃排查

程序崩溃时,先读日志,不要盲目改代码:

<exe目录>/logs/rambos_*.log   ← 查看崩溃前最后一条消息
<exe目录>/crash_*.dmp         ← 用 WinDbg 加载,附上 .pdb 查调用栈

---

Clone this wiki locally