Build ffmpeg from source in Dockerfile#30569
Conversation
|
Please split the vips part from the ffmpeg part. Also, how to we ensure that we update those versions regularly? |
|
I've given this PR a test as well... and this looks good on my machine. |
When paired with #30602 both libvips and ffmpeg versions will be tracked by Renovate |
|
This has been renamed and rebased to only include |
|
I love this, but I wonder how we should handle the supported ffmpeg versions. Major versions might have incompatible options, and I dont think we even care about this right now, or we provide a minimum supported ffmpeg version? |
|
Closes #20838 |
This shouldn't really impact overall supported versions, although ffmpeg would probably be the hardest one to come up with a minimum supported version as they're still providing updates for their 2.8.x |
renchap
left a comment
There was a problem hiding this comment.
Looks good to me. We will probably need to run it in production and check that we do not have weird video formats/codecs that are no longer processed correctly due to a missing library.
I cleaned up some of the options that upon further review seemed unnecessary, and also added support for I'm hopeful we'll be covered on most formats/codecs as it seems like a lot of the more advanced libraries are around encoding files which Mastodon has limited format support on that side (H.264 with AAC video, or MP3 audio) |
|
Thanks for this @vmstan - I've been testing this PR without (known) regressions. |

This PR enhances the production Dockerfile by converting from installing the version
ffmpegthat is available in the Debian repos, to using a custom built versions. This has the following advantages:ffmpegis installed from the Debian repo, it includes a number of dependencies to support file formats that are not used or explicitly not desired in Mastodon, including the unused X11 server. Build libvips from source in Dockerfile #30571 took the first step in compiling libvips from source to eliminate this dependency. The size of the resulting Docker image built by this PR under 700MB!ffmpegis currently at 5.1.4 when 7.0.1 is available.ffmpeg compile/library settings
[--build-arg FFMPEG_VERSION="7.0.1"]libx264is used for H.264 video encodinglibx265is used for HEVC video encodinglibvpxis used for VP8/VP9 video encoding/decodinglibopusis used for Opus audio encoding/decodinglibdav1dis used for AV1 decodinglibmp3lameis used for MP3 encodinglibvorbisis used for Vorbis audio encoding/decodinglibwebpis used for WebP encodinglibsnappyis used for compression