Skip to content

ffmpeg with the build system replaced by zig

License

Notifications You must be signed in to change notification settings

dmorn/ffmpeg.zig

 
 

Repository files navigation

FFmpeg Packaged for Zig

This is a fork of ffmpeg, packaged for Zig. Unnecessary files have been deleted, and the build system has been replaced with build.zig. The upstream branch of this repository contains a mirror of the official ffmpeg source tree. When an upstream release is tagged, the changes are merged from upstream into this main branch.

Update Process

These are the instructions to update this package when a new FFmpeg version is released upstream.

  1. Merge the new tag into main and resolve all conflicts by replacing the conflicting files with the files from upstream.
  2. find libavcodec/ libavdevice/ libavfilter/ libavformat libavutil/ libswscale/ libswresample/ -type f -name "*.asm" -o -name "*.c" -o -name "*.S"
    • Edit to omit files ending in _template.c or _tablegen.c
    • Sort the list
    • Update the all_sources list in build.zig.
  3. 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
  4. Run ./configure --prefix=$HOME/local/ffmpeg --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-programs --enable-libmp3lame --enable-libvorbis against upstream and diff the generated config.h file to the one generated by this build script. Apply appropriate changes to build.zig.
  5. Update these files which are generated by the upstream configure script:
    • config_components.h
    • libavfilter/filter_list.c
    • libavcodec/codec_list.c
    • libavcodec/parser_list.c
    • libavcodec/bsf_list.c
    • libavformat/demuxer_list.c
    • libavformat/muxer_list.c
    • libavdevice/indev_list.c
    • libavdevice/outdev_list.c
    • libavformat/protocol_list.c
  6. Update the headers list in build.zig based on what files are present in $HOME/local/ffmpeg/include.

About

ffmpeg with the build system replaced by zig

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 91.9%
  • Assembly 7.4%
  • Zig 0.2%
  • C++ 0.2%
  • Objective-C 0.2%
  • Cuda 0.1%