FFmpeg and x264 circular dependency

Andrew Berg aberg010 at my.hennepintech.edu
Sun Mar 2 05:43:22 UTC 2014

Currently, FFmpeg and x264 depend on each other, though not completely. FFmpeg needs libx264 to do H.264 encoding, which is fine. However,
the x264 CLI utility requires libavcodec and libavformat (which FFmpeg supplies) in order to provide lavf support (demuxing and decoding a
standard video file instead of requiring raw video). This has likely not been noticed before since x264 will build without FFmpeg (and if
FFmpeg is not present, x264 will simply not have lavf support). The issue is that if there is an update to x264 and it is rebuilt while
FFmpeg is present, it will link to several libav libraries in order to get lavf/lavc support. pkg will detect this and register FFmpeg as a
dependency of x264.

In order to avoid this, there are currently 3 ideas between the x264 maintainer (who is cc'd) and I:
 - Disable libav support in x264 entirely
 - Split FFmpeg and libav into separate ports, thereby making x264 dependent on libav and not FFmpeg
 - Split x264 into x264cli and libx264, thereby making FFmpeg dependent only on libx264

The first is not preferable since it removes a feature that many people use. The third is a little better, but it might be clunky to make
x264 explicitly dependent on FFmpeg. I much prefer the second since libav is widely used and things that use it do not necessarily need
FFmpeg itself.

What would it take to separate libav into its own port? I realize the change would be disruptive, but it seems a lot cleaner than keeping it
bundled with FFmpeg, even if FFmpeg bundles libav upstream, and it would solve this issue and potentially some similar issues with other
ports that use libav. There is a separate git repository for libav[1], however, I do not know how well it works with the rest of FFmpeg[2].

[1] https://git.libav.org/?p=libav.git;a=summary
[2] https://github.com/FFmpeg/FFmpeg

More information about the freebsd-multimedia mailing list