SubtitleEdit/subtitleedit · critical · PlatformNotSupportedException
Unsupported macOS architecture.
Error message
Unsupported macOS architecture.
What it means
Thrown by FfmpegDownloadService.GetUrl() in the default case of the macOS architecture switch. The switch handles Arm64 (MacUrlArm) and X64 (MacUrl) but any other Architecture value on macOS falls through. PlatformNotSupportedException indicates no FFmpeg build URL exists for that combination.
Source
Thrown at src/ui/Logic/Download/FfmpegDownloadService.cs:44
}
private static string GetFfmpegUrl()
{
if (OperatingSystem.IsWindows())
{
return WindowsUrl;
}
if (OperatingSystem.IsMacOS())
{
switch (RuntimeInformation.ProcessArchitecture)
{
case Architecture.Arm64:
return MacUrlArm; // e.g., for M1, M2, M3, M4 chips
case Architecture.X64:
return MacUrl;
default:
throw new PlatformNotSupportedException("Unsupported macOS architecture.");
}
}
throw new PlatformNotSupportedException();
}
public async Task DownloadFfmpeg(string destinationFileName, IProgress<float>? progress, CancellationToken cancellationToken)
{
await DownloadHelper.DownloadFileAsync(_httpClient, GetFfmpegUrl(), destinationFileName, progress, cancellationToken);
}
public async Task DownloadFfmpeg(Stream stream, IProgress<float>? progress, CancellationToken cancellationToken)
{
await DownloadHelper.DownloadFileAsync(_httpClient, GetFfmpegUrl(), stream, progress, cancellationToken);
}
}View on GitHub (pinned to 17a9f07487)
Solutions
- Confirm RuntimeInformation.ProcessArchitecture on the failing machine — if it's an unexpected value, investigate the runtime/host.
- Run on standard Apple Silicon (Arm64) or Intel (X64) macOS, both of which have URLs.
- If a legitimate new architecture must be supported, add its case returning the corresponding FFmpeg build URL.
Example fix
// before
switch (RuntimeInformation.ProcessArchitecture)
{
case Architecture.Arm64: return MacUrlArm;
case Architecture.X64: return MacUrl;
default: throw new PlatformNotSupportedException("Unsupported macOS architecture.");
}
// after: add explicit handling for the new arch
switch (RuntimeInformation.ProcessArchitecture)
{
case Architecture.Arm64: return MacUrlArm;
case Architecture.X64: return MacUrl;
case Architecture.Arm: return MacUrlArm; // 32-bit ARM fallback
default: throw new PlatformNotSupportedException($"Unsupported macOS architecture: {RuntimeInformation.ProcessArchitecture}");
} Defensive patterns
Strategy: validation
Validate before calling
static bool IsFfmpegSupportedOnMac()
=> !OperatingSystem.IsMacOS()
|| RuntimeInformation.ProcessArchitecture is Architecture.Arm64 or Architecture.X64;
if (!IsFfmpegSupportedOnMac()) { DisableFfmpegDownload(); return; } Type guard
static bool FfmpegMacSupported()
=> !OperatingSystem.IsMacOS()
|| RuntimeInformation.ProcessArchitecture is Architecture.Arm64 or Architecture.X64; Try / catch
try { var url = FfmpegDownloadService.GetUrl(); }
catch (PlatformNotSupportedException ex) when (OperatingSystem.IsMacOS())
{ _logger.Warning("FFmpeg download disabled on this Mac arch: {Arch}", RuntimeInformation.ProcessArchitecture); DisableFfmpegDownload(); } Prevention
- Log ProcessArchitecture on macOS to spot misreported values.
- Add explicit cases when adopting new .NET runtimes that introduce Architecture members.
- Provide a manual FFmpeg install path for unsupported arches.
When it happens
Trigger: OperatingSystem.IsMacOS() is true but ProcessArchitecture is neither Arm64 nor X64 — e.g. a future Architecture enum value, or a misreported architecture under a translation layer. In practice rare, since Apple hardware is either Apple Silicon or Intel.
Common situations: New .NET runtime introducing an Architecture enum member the switch doesn't list; exotic virtualization reporting an odd architecture; macOS-on-ARM running under a non-standard ABI. Intel and Apple Silicon are both covered, so normal Macs never hit this.
Related errors
- Unsupported macOS architecture.
- MacOS not supported.
- Unsupported macOS architecture.
- Google Lens OCR does not support this platform
- LibVLC download is not supported on this platform
AI-assisted analysis of SubtitleEdit/subtitleedit@17a9f07487 (2026-08-13).
Data as JSON: /api/errors/db1ce8e0a89e6a7b.
Report an issue: GitHub.