# VLCatch **Repository Path**: barryhippo/vlcatch ## Basic Information - **Project Name**: VLCatch - **Description**: No description available - **Primary Language**: C++ - **License**: MulanPSL-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-06-01 - **Last Updated**: 2026-06-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # VLC Downloader 跨平台 M3U8 → MP4 批量转存工具。直接调用 libvlc C API,内置 libvlc,无需用户安装 VLC。 ## 功能 - 输入 M3U8 链接,设置输出文件名,一键开始转存 - 同时运行多个转存任务,实时查看状态和进度 - 支持 HTTP 代理(含认证),配置自动保存 - 跨平台:Windows / macOS / Linux ## 截图(UI 预览) ``` ┌─────────────────────────────────────────────────────────────────┐ │ [+ 添加任务] [代理设置] 代理: 127.0.0.1:7890 │ ├──┬────────────┬────────────────────┬──────┬───────┬─────┬───────┤ │# │ 文件名 │ URL │ 状态 │ 进度 │耗时 │ 操作 │ ├──┼────────────┼────────────────────┼──────┼───────┼─────┼───────┤ │1 │ a.mp4 │ http://…/test.m3u8 │转存中│ ████░ │1:23 │ [停止]│ │2 │ b.mp4 │ http://…/live.m3u8 │ 完成 │ █████ │5:01 │ [删除]│ └──┴────────────┴────────────────────┴──────┴───────┴─────┴───────┘ ``` --- ## 构建步骤 ### 1. 前置依赖 - CMake ≥ 3.21 - vcpkg(用于安装 SDL2 和 Dear ImGui) - C++17 编译器(MSVC 2022 / Clang 14+ / GCC 11+) ### 2. 安装 vcpkg 依赖 ```bash # 如果没有 vcpkg,先克隆 git clone https://github.com/microsoft/vcpkg.git ./vcpkg/bootstrap-vcpkg.sh # Linux/macOS # 或 .\vcpkg\bootstrap-vcpkg.bat (Windows) # 安装依赖(vcpkg.json 会自动处理) export VCPKG_ROOT=/path/to/vcpkg ``` ### 3. 获取 libvlc SDK 见 [vlc/include/vlc/vlc.h](vlc/include/vlc/vlc.h) 中的平台说明。 简要步骤: **Linux:** ```bash sudo apt install libvlc-dev cp -r /usr/include/vlc/ vlc/include/vlc/ cp /usr/lib/x86_64-linux-gnu/libvlc.so* vlc/lib/ cp /usr/lib/x86_64-linux-gnu/libvlccore.so* vlc/lib/ ``` **macOS:** ```bash brew install --cask vlc cp -r /Applications/VLC.app/Contents/MacOS/include/vlc/ vlc/include/vlc/ cp /Applications/VLC.app/Contents/MacOS/lib/libvlc*.dylib vlc/lib/ ``` **Windows:** 注意:sdk/ 目录只在**便携版 zip 包**里,不在 .exe 安装包中。 - 64位:`https://download.videolan.org/pub/videolan/vlc/last/win64/` → 下载 `vlc-3.x.x-win64.zip` - 解压后找到 `vlc-3.x.x\sdk\include\vlc\` → 复制到 `vlc/include/vlc/` - `vlc-3.x.x\sdk\lib\` → 复制 libvlc.lib / libvlccore.lib 到 `vlc/lib/` - `vlc-3.x.x\libvlc.dll` + `libvlccore.dll` → 复制到 `vlc/lib/` ### 4. 复制最小插件集 按照 [vlc/plugins/README.md](vlc/plugins/README.md) 说明,从 VLC 安装目录复制约 10 个插件文件到 `vlc/plugins/`。 ### 5. 获取 imgui 后端文件(SDL2 + OpenGL3) imgui 后端直接放入 `src/`,不通过 vcpkg feature 引入。从 imgui 发布包 `backends/` 目录复制这 4 个文件到 `src/`: ``` imgui_impl_sdl2.h imgui_impl_sdl2.cpp imgui_impl_opengl3.h imgui_impl_opengl3.cpp imgui_impl_opengl3_loader.h ``` 或用 curl: ```cmd cd src curl -LO https://raw.githubusercontent.com/ocornut/imgui/master/backends/imgui_impl_sdl2.h curl -LO https://raw.githubusercontent.com/ocornut/imgui/master/backends/imgui_impl_sdl2.cpp curl -LO https://raw.githubusercontent.com/ocornut/imgui/master/backends/imgui_impl_opengl3.h curl -LO https://raw.githubusercontent.com/ocornut/imgui/master/backends/imgui_impl_opengl3.cpp curl -LO https://raw.githubusercontent.com/ocornut/imgui/master/backends/imgui_impl_opengl3_loader.h ``` ### 6. 获取 tinyfiledialogs ```bash # 在 src/ 目录下 curl -L "https://sourceforge.net/p/tinyfiledialogs/code/ci/master/tree/tinyfiledialogs.h?format=raw" -o src/tinyfiledialogs.h curl -L "https://sourceforge.net/p/tinyfiledialogs/code/ci/master/tree/tinyfiledialogs.c?format=raw" -o src/tinyfiledialogs.c ``` ### 7. 构建 ```cmd rem Windows set VCPKG_FORCE_SYSTEM_BINARIES=1 cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%\scripts\buildsystems\vcpkg.cmake cmake --build build --config Release ``` ```bash # Linux / macOS cmake -B build -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake cmake --build build --config Release ``` ### 7. 运行 确保 `libvlc` 共享库和 `vlc-plugins/` 目录与可执行文件在同一目录: ``` build/Release/ ├── vlc-downloader(.exe) ├── libvlc.so.5 / libvlc.dll / libvlc.dylib ├── libvlccore.so.9 / libvlccore.dll └── vlc-plugins/ ├── libadaptive_plugin.so ├── libmp4_plugin.so └── ... ``` ### 8. 打包分发 ```bash cmake --install build --prefix dist/ # 或用 CPack: cd build && cpack ``` --- ## 技术栈 | 组件 | 版本 | |------|------| | libvlc | ≥ 3.0.18 | | Dear ImGui | ≥ 1.89 | | SDL2 | ≥ 2.26 | | tinyfiledialogs | 3.x | | CMake | ≥ 3.21 |