| .. | ||
| macos | ||
| windows | ||
| build_macos.jai | ||
| generate.jai | ||
| macos.jai | ||
| module.jai | ||
| README.md | ||
| windows.jai | ||
FFmpeg module for jai
FFmpeg bindings for jai and some examples decoding and play videos.
In mcap
FFmpeg 6.0 on both systems, so the two sets of bindings match:
- Windows:
windows/holds the DLLs and import libraries of a GPL "full" build from gyan.dev (windows/LICENSE-BUILD.txt), andwindows.jaithe bindings made from its headers (Setup below). - macOS:
macos/holdslibavcodec,libavformat,libavutil,libswresampleandlibswscale, an LGPL build for Apple silicon made from the release's source byjai build_macos.jai(about a minute;macos/LICENSE-BUILD.txthas its configure options). It also installs the headers inmacos-build/(not in git), from whichjai generate.jaion a Mac makesmacos.jai. The libraries are linked withno_dll, so the compiler does not load them, and copied beside the executable, where its@loader_pathrpath finds them.
Setup
The FFmpeg libaries and header files are not included in this repo as I didn't want to have to deal with license things. Unfortunately this means that there is some labour to get things working. The approximate steps are:
- Download "shared" binaries. I got them from here. Eg "ffmpeg-release-full-shared.7z". At the time of writing the latest release build was version 6.0.
- Copy all the directories in the Include directory to ffmpeg/src. There will then be, eg, a ffmpeg/src/libavcodec/codec.h file.
- Copy all the dlls from the bin directory to ffmpeg/windows
- Copy all the libs from the lib directory to ffmpeg/windows. You may then need to rename the lib files so the names match the versioned dll names. (This may not actually be necessary, but that is how I generated bindings. I'm not worrying about it as probably it makes more sense to some day work out how to compile the libraries myself so they don't include verion names in them).
There may be additional work for platforms other than windows, I only tried on windows!
You may need to add aditional source files in generate.jai if bindings you want are not present.
You will also need to copy the dlls into whatever directory your exe is in.