Skip to content

Feat/add vmaf - #256

Closed
mockodin wants to merge 3 commits into
PyAV-Org:mainfrom
mockodin:feat/add-vmaf
Closed

Feat/add vmaf#256
mockodin wants to merge 3 commits into
PyAV-Org:mainfrom
mockodin:feat/add-vmaf

Conversation

@mockodin

Copy link
Copy Markdown

Summary

Add VMAF 3.2.0 to the bundled FFmpeg builds and enable FFmpeg's libvmaf filter across supported native and cross-compiled platforms.

The build now verifies both the packaged VMAF runtime library and the ability to locate and initialize the libvmaf filter.

Implementation Details

  • Add VMAF 3.2.0 to the codec dependency group.
    • Verify the source archive with a pinned SHA-256 digest.
    • Build libvmaf as a shared library with Meson.
    • Disable VMAF tests, documentation, and command-line tools.
  • Configure FFmpeg with --enable-libvmaf.
  • Validate every generated archive before accepting or reusing it.
    • Windows: require bin/libvmaf.dll.
    • macOS: require a non-empty lib/libvmaf.*.dylib.
    • Linux: require a non-empty versioned lib/libvmaf.so.*.
  • Extend the existing package import smoke test.
    • Locate the libvmaf filter with avfilter_get_by_name.
    • Create a filter graph and initialize the filter.
    • Raise a Python exception when lookup, allocation, or initialization fails.
    • Keep verification isolated in verify_libvmaf_filter().
    • Preserve the existing FFmpeg is OK success output.
  • Provision a compatible xxd implementation for VMAF model embedding.
    • Test the exact xxd -i INPUT OUTPUT invocation VMAF requires.
    • Reject incompatible implementations that cannot write to an output file.
    • Install xxd through the available Linux package manager when needed.
    • Install vim in MSYS2 builds to provide xxd on Windows.
  • Run the host-tool setup before native Linux, manylinux, and musllinux builds.
  • Fail artifact upload steps when a build produces no output.
  • Document VMAF 3.2.0 in the enabled dependency list.

Testing Done

  • Full GitHub Actions build matrix passed for the VMAF integration:
    • macOS arm64 and x86_64
    • Linux aarch64 and x86_64
    • Windows ARM64 and x86_64
    • manylinux armv7l, ppc64le, and riscv64
    • musllinux armv7l, ppc64le, and riscv64
  • Reproduced the musllinux environment and verified replacement of an incompatible xxd implementation.
  • Confirmed generated archives contain a non-empty platform-specific VMAF runtime library.
  • Confirmed the packaged FFmpeg build exposes and initializes the libvmaf filter.
  • Strict C syntax and type checking passed after extracting verify_libvmaf_filter().
  • git diff --check passed.

@WyattBlue

Copy link
Copy Markdown
Member

d7a92d1

@mockodin

Copy link
Copy Markdown
Author

Closing, I was late in posting and missed that @WyattBlue got there first :)
#253

@mockodin mockodin closed this Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants