This is a fork of ffmpeg, packaged for Zig. Unnecessary
files have been deleted, and the build system has been replaced with
build.zig.
There are no system dependencies; the only thing required to build this package is Zig.
Zig API bindings are also provided via the "av" module. See doc/examples for
API usage examples.
zig fetch --save=ffmpeg https://github.com/allyourcodebase/ffmpeg/archive/refs/tags/7.0.1-5.tar.gz
// build.zig
const ffmpeg_dep = b.dependency("ffmpeg", .{.target = target, .optimize = optimize});
Choose one:
Just link ffmpeg:
exe.root_module.linkLibrary(ffmpeg_dep.artifact("ffmpeg"));
Add zig bindings with @import("ffmpeg")
exe.root_module.addImport("ffmpeg", ffmpeg_dep.module("av"));
More can be added as desired.
These are the instructions to update this package when a new FFmpeg version is released upstream.
Merge the new tag into main and resolve all conflicts by replacing the conflicting files with the files from upstream.
find libavcodec/ libavdevice/ libavfilter/ libavformat libavutil/ libswscale/ libswresample/ -type f -name "*.asm" -o -name "*.c" -o -name "*.S"
_template.c or _tablegen.call_sources list in build.zig.Inspect the git diff to keep some of the source files commented out like they were before. Some handy filtering rules apply:
/L prefix means Linux-only/W prefix means Windows-only/U prefix means every target except WindowsRun ./configure --prefix=$HOME/local/ffmpeg --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-programs --enable-libmp3lame --enable-libvorbis --disable-shared --enable-static
against upstream and diff the generated config.h file to the one generated
by this build script. Apply appropriate changes to build.zig.
config.hconfig_components.havconfig.hRun configure a second time for Windows, adding --enable-cross-compile --arch=x86_64 --target-os=mingw32 --cc="zig cc -target x86_64-windows-gnu",
and diff the two generated config.h files against each other: every entry
that differs is one build.zig has to decide from the target rather than
hardcode.
Update these files which are generated by the upstream configure script:
libavfilter/filter_list.clibavcodec/codec_list.clibavcodec/parser_list.clibavcodec/bsf_list.clibavformat/demuxer_list.clibavformat/muxer_list.clibavdevice/indev_list.clibavdevice/outdev_list.clibavformat/protocol_list.c, whose ff_unix_protocol entry is wrapped
in #if CONFIG_UNIX_PROTOCOL so the list also builds for WindowsUpdate the headers list in build.zig based on what files are present in
$HOME/local/ffmpeg/include.
This package copies code from upstream ffmpeg project and therefore also copies the original license files, unedited. All the Zig code added on top of this (i.e. build.zig and av.zig) is MIT licensed:
Copyright (c) contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
C
90.1%
Assembly
8.6%
This is a fork of ffmpeg, packaged for Zig. Unnecessary
files have been deleted, and the build system has been replaced with
build.zig.
There are no system dependencies; the only thing required to build this package is Zig.
Zig API bindings are also provided via the "av" module. See doc/examples for
API usage examples.
zig fetch --save=ffmpeg https://github.com/allyourcodebase/ffmpeg/archive/refs/tags/7.0.1-5.tar.gz
// build.zig
const ffmpeg_dep = b.dependency("ffmpeg", .{.target = target, .optimize = optimize});
Choose one:
Just link ffmpeg:
exe.root_module.linkLibrary(ffmpeg_dep.artifact("ffmpeg"));
Add zig bindings with @import("ffmpeg")
exe.root_module.addImport("ffmpeg", ffmpeg_dep.module("av"));
More can be added as desired.
These are the instructions to update this package when a new FFmpeg version is released upstream.
Merge the new tag into main and resolve all conflicts by replacing the conflicting files with the files from upstream.
find libavcodec/ libavdevice/ libavfilter/ libavformat libavutil/ libswscale/ libswresample/ -type f -name "*.asm" -o -name "*.c" -o -name "*.S"
_template.c or _tablegen.call_sources list in build.zig.Inspect the git diff to keep some of the source files commented out like they were before. Some handy filtering rules apply:
/L prefix means Linux-only/W prefix means Windows-only/U prefix means every target except WindowsRun ./configure --prefix=$HOME/local/ffmpeg --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-programs --enable-libmp3lame --enable-libvorbis --disable-shared --enable-static
against upstream and diff the generated config.h file to the one generated
by this build script. Apply appropriate changes to build.zig.
config.hconfig_components.havconfig.hRun configure a second time for Windows, adding --enable-cross-compile --arch=x86_64 --target-os=mingw32 --cc="zig cc -target x86_64-windows-gnu",
and diff the two generated config.h files against each other: every entry
that differs is one build.zig has to decide from the target rather than
hardcode.
Update these files which are generated by the upstream configure script:
libavfilter/filter_list.clibavcodec/codec_list.clibavcodec/parser_list.clibavcodec/bsf_list.clibavformat/demuxer_list.clibavformat/muxer_list.clibavdevice/indev_list.clibavdevice/outdev_list.clibavformat/protocol_list.c, whose ff_unix_protocol entry is wrapped
in #if CONFIG_UNIX_PROTOCOL so the list also builds for WindowsUpdate the headers list in build.zig based on what files are present in
$HOME/local/ffmpeg/include.
This package copies code from upstream ffmpeg project and therefore also copies the original license files, unedited. All the Zig code added on top of this (i.e. build.zig and av.zig) is MIT licensed:
Copyright (c) contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
(top 30 of 312)
C
90.1%
Assembly
8.6%