Skip to content

meson: build the bundled ffmpeg without unused components - #728

Merged
arch1t3cht merged 1 commit into
TypesettingTools:masterfrom
CoffeeFlux:trim-ffmpeg
Oct 8, 2026
Merged

arch1t3cht merged 1 commit into
TypesettingTools:masterfrom
CoffeeFlux:trim-ffmpeg

Conversation

@CoffeeFlux

Copy link
Copy Markdown
Member

ffms2 only demuxes and decodes local files, so the bundled ffmpeg doesn't need libavdevice, libavfilter, encoders, muxers or network support. This disables them through the meson port's own options, with no patches. It only affects builds that use the bundled ffmpeg (CI on Windows and macOS, and local fallback builds).

  • ffmpeg compiles drop from 2,186 to 1,447, about a third fewer. Locally that was 29% less CPU, and a static ffms2 test binary went from 19.6 MB to 16.3 MB.
  • Every decoder, parser and bitstream filter is still built. The only demuxers lost are network-streaming ones: RTP, RTSP, SAP and SDP.
  • The file protocol, which ffms2 uses to open files, stays.

Testing (macOS):

  • Built ffms2 against both versions and ran a small program that does what Aegisub does: index, decode video frames to BGRA, and decode audio. It covered H.264 (8- and 10-bit), HEVC, VP9, AV1, MPEG-2, MPEG-4 and ProRes in MP4, MKV, WebM, TS, AVI and MOV, plus FLAC, MP3 and WAV. Both versions gave identical results.
  • Aegisub builds against the trimmed static ffmpeg and its tests pass.

🤖 Generated with Claude Code

ffms2 only demuxes and decodes local files, so disable libavdevice,
libavfilter, encoders, muxers and network support in the ffmpeg
fallback. This drops about a third of ffmpeg's compiles (2186 to 1447)
while keeping every decoder, parser, bitstream filter and local-file
demuxer; the only demuxers lost are the network ones (RTP, RTSP, SAP,
SDP). It only affects builds that use the bundled ffmpeg.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CoffeeFlux
CoffeeFlux marked this pull request as ready for review October 8, 2026 18:27
@arch1t3cht
arch1t3cht merged commit 7577c1c into TypesettingTools:master Oct 8, 2026
9 checks passed
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