GithubHelp home page GithubHelp logo

harfang3d / harfang-plugin-ffmpeg Goto Github PK

View Code? Open in Web Editor NEW
2.0 5.0 2.0 305 KB

FFmpeg video player plugin for HARFANG 3D framework

License: MIT License

CMake 15.80% C++ 39.01% Shell 35.06% Scala 1.03% Lua 2.50% C 6.61%
harfang3d ffmpeg video-plugin lua cpp

harfang-plugin-ffmpeg's Introduction

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=<path where FFmpeg sdk> \
    -DCMAKE_INSTALL_PREFIX=<plugin install path>

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=<plugin install path>

● 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=<path to harfang cpp sdk> \
         -DHG_ASSETC_PATH=<path to assetc> \
         -DHG_VIDEO_STREAM_PLUGIN=<plugin filepath> \
         -DCMAKE_INSTALL_PREFIX=<install path>

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

test program screenshot

● Lua sample

The test directory also contains a lua script (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.

harfang-plugin-ffmpeg's People

Contributors

astrofra avatar blockos avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.