https://github.com/harfang3d/harfang-plugin-ffmpeg
FFmpeg video player plugin for HARFANG 3D framework
https://github.com/harfang3d/harfang-plugin-ffmpeg
cpp ffmpeg harfang3d lua video-plugin
Last synced: about 1 month ago
JSON representation
FFmpeg video player plugin for HARFANG 3D framework
- Host: GitHub
- URL: https://github.com/harfang3d/harfang-plugin-ffmpeg
- Owner: harfang3d
- License: mit
- Created: 2022-03-01T11:29:38.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-06-07T07:54:27.000Z (almost 3 years ago)
- Last Synced: 2023-03-10T19:25:54.756Z (about 2 years ago)
- Topics: cpp, ffmpeg, harfang3d, lua, video-plugin
- Language: C++
- Homepage:
- Size: 298 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FFmpeg video plugin
## Prerequisites
### ● Harfang C++ SDK
The Harfang C++ SDK is only required to build the sample test program.### ● FFmpeg libraries
You can either use the binary packages from the FFmpeg website or any package manager (apt, pacman, homebrew, chocolatey...).## Build
Both plugin and sample can be built using CMake and any recent C/C++ compiler (gcc, clang, msvc...).### ● FFmpeg plugin
To build the plugin, go to the source directory and create a build directory where CMake configuration will be performed.On Windows, you must defined `FFMPEG_ROOT`. This variable contains the path to the FFmpeg libraries and header files.
```
mkdir build
cd build
cmake .. \
-DFFMPEG_ROOT= \
-DCMAKE_INSTALL_PREFIX=
```On Linux, do not forget to specify `CMAKE_BUILD_TYPE` or the install will fail. If FFmpeg was installed using the system package manager, there is no need to specify `FFMPEG_ROOT`.
```
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=
```### ● Test program
The sample program requires Harfang C++ SDK, Asset compiler (assetc) and the FFmpeg plugin (or any video stream plugin).```
cmake .. -DHG_CPPSDK_PATH= \
-DHG_ASSETC_PATH= \
-DHG_VIDEO_STREAM_PLUGIN= \
-DCMAKE_INSTALL_PREFIX=
```Once the build is complete, the install directory should contain all the required shared libraries and an executable binary named `hg_vid_play`.
```
hg_vid_play movie.mp4
```
### ● Lua sample
The test directory also contains a lua script ([main.lua](./test/main.lua)). This script maps a video stream onto a spinning cube.
Note that you need the Harfang 3D lua 5.3 to run it.