fix(ffmpeg): point macOS at evermeet's ffprobe archive, not its ffmpeg one - #786
fix(ffmpeg): point macOS at evermeet's ffprobe archive, not its ffmpeg one#786m4bard wants to merge 1 commit into
Conversation
…g one The bundled ffprobe install can never succeed on macOS. FfprobePlatformDefaults returns evermeet's ffmpeg archive, and evermeet ships one binary per archive, so the download succeeds and FfprobeArchiveExtractor then finds no ffprobe entry to install. Metadata import is broken on every Mac as a result. evermeet publishes ffprobe as its own archive at the same version, so this points macOS at ffprobe-6.0.zip instead of ffmpeg-6.0.zip. Same version, same host, same extraction path; only the artifact changes. Verified against the live archives: ffmpeg-6.0.zip holds a single entry, ffmpeg, with no ffprobe anywhere in it, while ffprobe-6.0.zip holds a single ffprobe that file reports as a Mach-O 64-bit x86_64 executable. x86_64 is what is wanted here, since the project publishes osx-x64 only and is therefore always an x64 process on macOS, natively on Intel and under Rosetta on Apple Silicon. Adds an internal GetDownloadUrl(OSPlatform, Architecture) overload so the mapping for every platform can be asserted from a test host on any one of them, and tests covering the macOS regression plus two invariants that hold everywhere: the macOS filename has to name ffprobe, and every URL has to end in a suffix the extractor dispatches on. The second one matters because evermeet's getrelease endpoint redirects to the current release and ends in /zip, so it looks like the tidier target and would extract nothing. macOS stays on 6.0 and GetChecksum() still returns null. Both are deliberate: a version bump needs evidence I cannot produce without a Mac, and pinning with checksums is the wider half of Listenarrs#777 and applies to all three platforms. Refs Listenarrs#777
|
Ran this on an actual Mac rather than inferring it from the archive contents, since "the binary is the right architecture" and "the binary runs and produces the fields we read" are different claims and only the second one matters here. Apple Silicon, macOS 26.6. That is the interesting case: the project ships The two archives, fetched fresh:
The extracted binary reports as Then the command the service issues, against a one-second tagged m4b: Every field Two details worth recording. The test file was built with the One thing this does raise, though it is not a reason to change anything here. evermeet publishes x86_64 only, so both the current default and this PR put a translated binary on Apple Silicon. The durable-source option from #777 would additionally fix that: jellyfin-ffmpeg's current release carries There is a wrinkle if anyone picks that up. |
Summary
Fixes #777. The bundled ffprobe install can never succeed on macOS. The platform default points at evermeet's ffmpeg archive, and evermeet ships one binary per archive, so the download succeeds and the extractor then finds no
ffprobeentry to install. Metadata import stays broken on every Mac.evermeet publishes ffprobe as its own archive at the same version, so pointing macOS there fixes the install without touching any other platform.
Changes
Fixed
https://evermeet.cx/ffmpeg/ffprobe-6.0.ziprather thanffmpeg-6.0.zip. The version is the same, so this changes which artifact is fetched and nothing about how it is handled.Added
GetDownloadUrl(OSPlatform, Architecture)overload, so the mapping for every platform can be asserted from a test host running on any one of them. The public no-argument method behaves as it did and now delegates to it.FfprobePlatformDefaultsTests, covering the macOS regression and two invariants that hold for every platform.Testing
Checked against the live archives before changing anything:
x86_64 is the right architecture to want here, since the project publishes
osx-x64only. On macOS it is therefore always an x64 process, running natively on Intel and under Rosetta on Apple Silicon.12 new unit tests. The full backend suite passes locally on .NET 10, 1201 tests.
Two of the new tests assert invariants rather than a specific string, because a URL constant by itself is not worth a test:
FfprobeArchiveExtractorpicks zip or tar handling from the URL suffix, so a URL outside.zip,.tar.xz,.tar.gzand.tgzdownloads cleanly and then extracts nothing. That is worth guarding for this fix specifically. evermeet has agetrelease/ffprobe/zipendpoint that redirects to the current release, which looks like the tidier thing to point at and would fail quietly, because the URL ends in/zip. Naming the file avoids it.Notes
This is the narrow fix. Two related things I left out rather than fold in.
macOS stays on ffprobe 6.0. evermeet's current release is 8.1.2 and there is a versioned
.zipURL for it, but I cannot execute a Mach-O binary on the Linux machine I tested from, so I cannot show that a version bump leaves the fieldsFfprobeMetadataMapperreads unchanged. That wants its own change and its own evidence.GetChecksum()still returnsnull, so this download stays unverified, as the Linux and Windows ones are. That is the wider half of #777: the platform defaults are unpinned and unverified, and macOS is where it happens to be fatal rather than merely risky. The durable answer is the second option in that issue, switching the defaults to thegithub:provider path with a pinned release and a checksum, which covers all three platforms at once.FfmpegServicealready has that machinery, includingProvider,ReleaseOverride,Arch,ChecksumUrl,FfprobeGithubAssetDiscovererand abort-on-mismatch, so what is left is choosing a source to pin to and deciding whether you want that behaviour change for existing Linux and Windows users. I am happy to build it if you do.One thing worth knowing in the meantime: the
github:provider is not gated on the platform default being null and overrides it whenever discovery succeeds. A Mac user can unblock themselves today by settingFfmpeg.Provider, without waiting for a release.