go-ffmpreg
empregge- sorry, uh... embedded ffmpeg WASM binaries with a small Go library wrapper, using wazero WebAssembly runtime
ffmpeg version: n5.1.6
(the latest version not reliant on pthreads)
yes, you will have to publicly acknowledge the fact you used ffmpreg
as this is GPL
ffmpeg is built with GPLv3 code enabled and with the following external libraries:
for a list of what ffmpeg supports (and what it requires external libaries for) see: https://www.ffmpeg.org/general.html#External-libraries
the resulting binaries are passed through many wasm-opt
optimization passes focusing on speed, and size, such that the resulting embeddded binaries are each ~15MB
usage
see cmd/{ffmpeg,ffprobe}
for examples
ffmpeg may need access to /dev/
and /tmp
depending on what you are doing, please factor this when setting up directory mounts
note since wazero runtime is not aware of a "working directory", all paths passed must be absolute relative to filesystem mount
build
podman build --file=build/build.dockerfile
alternatively with far more optimization passes
podman build --file=build/build.dockerfile --build-arg RELEASE=yes
then copy /build/{ffmpeg,ffprobe}
from resulting image
the build system itself is separated into scripts found under build/
, which are called by build/build.dockerfile
. to build ffmpeg with a new external library add a new script for it under build/
that sources build/environ
and outputs library header, archive and pkg-config (if any) to /vendor
in the build image
future
-
more tests
-
update ffmpeg to n7.x.x
(requires wazero to fully support wasm threads proposal)
-
build with libjxl for JPEG XL, may rely on threads
-
build with libx265 for HEVC, may rely on threads
-
some form of AV1 encode / decode