mcap/modules/ffmpeg
2026-10-17 21:16:30 -04:00
..
macos [0.1.28] macOS phase 4: videos through FFmpeg 6.0 for macOS, an LGPL build made by build_macos.jai 2026-10-17 21:16:30 -04:00
windows [0.0.9] Import: videos and animated GIFs, in .mcap version 4 2026-10-09 23:10:55 +01:00
build_macos.jai [0.1.28] macOS phase 4: videos through FFmpeg 6.0 for macOS, an LGPL build made by build_macos.jai 2026-10-17 21:16:30 -04:00
generate.jai [0.1.28] macOS phase 4: videos through FFmpeg 6.0 for macOS, an LGPL build made by build_macos.jai 2026-10-17 21:16:30 -04:00
macos.jai [0.1.28] macOS phase 4: videos through FFmpeg 6.0 for macOS, an LGPL build made by build_macos.jai 2026-10-17 21:16:30 -04:00
module.jai [0.1.28] macOS phase 4: videos through FFmpeg 6.0 for macOS, an LGPL build made by build_macos.jai 2026-10-17 21:16:30 -04:00
README.md [0.1.28] macOS phase 4: videos through FFmpeg 6.0 for macOS, an LGPL build made by build_macos.jai 2026-10-17 21:16:30 -04:00
windows.jai [0.0.9] Import: videos and animated GIFs, in .mcap version 4 2026-10-09 23:10:55 +01:00

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), and windows.jai the bindings made from its headers (Setup below).
  • macOS: macos/ holds libavcodec, libavformat, libavutil, libswresample and libswscale, an LGPL build for Apple silicon made from the release's source by jai build_macos.jai (about a minute; macos/LICENSE-BUILD.txt has its configure options). It also installs the headers in macos-build/ (not in git), from which jai generate.jai on a Mac makes macos.jai. The libraries are linked with no_dll, so the compiler does not load them, and copied beside the executable, where its @loader_path rpath 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.