extension-ffmpeg
extension-ffmpeg copied to clipboard
An OpenFL extension which provides support for multimedia files on native platforms.
extension-ffmpeg
A Haxe library which provides support for handling video, audio, and multimedia files and streams on native platforms.
extension-ffmpeg boasts the following features:
- Decoding, display, and playback control for video and audio.
- Support for the most popular video formats, including
avi,mp4,webm,flv,mkv, and more. - Utilities for easy integration into OpenFL and HaxeFlixel.
Contributions are highly welcome! Feel free to open an issue or pull request if you have any questions or suggestions.
Building on Windows
To build extension-ffmpeg from source, perform these steps to fetch dependencies:
- Do NOT download the repository by clicking the
Download ZIPbutton on the Github page.
- Instead, run
git clone https://github.com/MasterEric/extension-ffmpegto create a local Git repository.
- Install Visual Studio 2019, installing the following components:
MSVC v142 - VS 2019 C++ x64/x86 build toolsWindows SDK (10.0.17763.0)
- Install MSYS2. I installed to the
C:/CPP/msys64directory. - Navigate to the project folder and call
git submodule update --init --recursive --remoteto download the source for FFmpeg.
Then, follow these steps:
- Open
x64 Native Tools Command Prompt for VS 2019and call"C:\CPP\msys64\msys2_shell.cmd" -use-full-path. - Call
pacman -Su git wget make tar unzip zip mingw-w64-x86_64-gcc mingw-w64-x86_64-gdb mingw-w64-x86_64-cmake autoconf automake libtool mingw-w64-x86_64-jq python zstd nasm(one-time step). - Navigate to the project folder, enter
./lib.src/, and run./build_win64.shto build theWindows64library files.
Now, we need to build libraries for 32-bit machines.
- This is necessary because
lime rebuildperforms two builds, one for each architecture.
- Open
x86 Native Tools Command Prompt for VS 2019and call"C:\CPP\msys64\msys2_shell.cmd" -use-full-path. - Navigate to the project folder, enter
./lib.src/ffmpeg, and runmake clean.
- This gets rid of any artifacts from the previous 64-bit build.
- Move back to
./lib.src/and runbuild_win32.shto build theWindows32library files.
This will generate the necessary .lib files that you need to build the extension.
To build the extension itself, run lime rebuild extension-ffmpeg windows.
You will need to repeat this step if you change any of the C++ files located in the project folder.
Be sure to run lime rebuild extension-ffmpeg windows -debug instead if you are planning to debug the target application.
Building on Linux
To build extension-ffmpeg from source, follow these steps:
- Do NOT download the repository by clicking the
Download ZIPbutton on the Github page.
- Instead, run
git clone https://github.com/MasterEric/extension-ffmpegto create a local Git repository.
- Install these development packages:
libvdpau-dev libva-dev libx11-dev - Navigate to the project folder.
- Call
git submodule update --init --recursive --remoteto download the source for FFmpeg. - Navigate to
./lib.src/. - Run
./build_linux64.sh.
- You will need to repeat this step if you modify the compile flags in the script (which are used to build FFmpeg's libs).
This will generate the necessary .a files that you need to build the extension.
To build the extension itself, run lime rebuild extension-ffmpeg linux.
You will need to repeat this step if you change any of the C++ files located in the project folder.
Be sure to run lime rebuild extension-ffmpeg linux -debug instead if you are planning to debug the target application.
Building on MacOS
To build extension-ffmpeg from source, follow these steps:
- Do NOT download the repository by clicking the
Download ZIPbutton on the Github page.
- Instead, run
git clone https://github.com/MasterEric/extension-ffmpegto create a local Git repository.
- Use Brew to install dependencies:
brew install nasm openssl
- Navigate to the project folder.
- Call
git submodule update --init --recursive --remoteto download the source for FFmpeg. - Navigate to
./lib.src/. - Run
./build_mac64.sh.
- You will need to repeat this step if you modify the compile flags in the script (which are used to build FFmpeg's libs).
This will generate the necessary .a files that you need to build the extension.
To build the extension itself, run lime rebuild extension-ffmpeg mac.
You will need to repeat this step if you change any of the C++ files located in the project folder.
Be sure to run lime rebuild extension-ffmpeg mac -debug instead if you are planning to debug the target application.
Building for android
To build extension-ffmpeg from source, follow these steps:
- Download and unzip the android ndk (r23c)
- Navigate to the project folder.
- Call
git submodule update --recursiveto download the source for FFmpeg. - Navigate to
./lib.src/. - Change the ndk path in
build_android64.shto your ndk path, - Run
./build_android64.sh.
This will generate the necessary .a files that you need to build the extension.
To build the extension itself, run lime rebuild extension-ffmpeg android.
this is still on testing, only 64 bits is supported as of now
Building on Other Platforms
Support for other platforms (Android, iOS, HTML5 via emscripten) is in development.
License
The extension-ffmpeg library is made available under the permissive MIT License.
This software utilizes libraries provided by FFmpeg, licensed under the LGPLv3.0. Its sources can be downloaded here.
Credits
- MasterEric - Creator, lead developer and maintainer.
- JonnyCat - MacOS support.
- The contributors.