Tyrrrz/YoutubeDownloader · error · PlatformNotSupportedException
Unsupported architecture: {RuntimeInformation.ProcessArchite
Error message
Unsupported architecture: {RuntimeInformation.ProcessArchitecture}. What it means
Thrown by the local GetArchitectureMoniker() inside FFmpeg.GetDownloadUrl() when building the FFmpeg download URL. The FFmpegBin release only publishes x64, x86, and arm64 builds, so any other RuntimeInformation.ProcessArchitecture cannot be mapped to an asset suffix and PlatformNotSupportedException is raised. The message interpolates the actual architecture for diagnostics.
Source
Thrown at YoutubeDownloader.Core/Downloading/FFmpeg.cs:102
if (OperatingSystem.IsMacOS())
return "osx";
throw new PlatformNotSupportedException("Unsupported operating system.");
}
static string GetArchitectureMoniker()
{
if (RuntimeInformation.ProcessArchitecture == Architecture.X64)
return "x64";
if (RuntimeInformation.ProcessArchitecture == Architecture.X86)
return "x86";
if (RuntimeInformation.ProcessArchitecture == Architecture.Arm64)
return "arm64";
throw new PlatformNotSupportedException(
$"Unsupported architecture: {RuntimeInformation.ProcessArchitecture}."
);
}
var sys = GetSystemMoniker();
var arch = GetArchitectureMoniker();
return $"https://github.com/Tyrrrz/FFmpegBin/releases/download/{Version}/ffmpeg-{sys}-{arch}.zip";
}
public static async Task DownloadAsync(
string outputFilePath,
IProgress<Percentage>? progress = null,
CancellationToken cancellationToken = default
)
{
var archiveFilePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName() + ".zip");
View on GitHub (pinned to bbcff03951)
Solutions
- Install a native FFmpeg for your architecture and put it in PATH so TryGetCliFilePath() resolves it and DownloadAsync is skipped.
- Pass ffmpegPath explicitly to VideoDownloader.DownloadVideoAsync(...) to bypass auto-download.
- Build an FFmpeg asset for the architecture, publish it under the FFmpegBin tag, and add the case to GetArchitectureMoniker().
Example fix
// before: auto-download fails on armhf (Architecture.Arm) await FFmpeg.DownloadAsync(outputPath, progress, ct); // after: prefer a distro-provided binary and pass it explicitly var ffmpeg = FFmpeg.TryGetCliFilePath() ?? "ffmpeg"; await downloader.DownloadVideoAsync(filePath, video, option, ffmpegPath: ffmpeg, progress: progress, cancellationToken: ct);
Defensive patterns
Strategy: validation
Validate before calling
static readonly HashSet<Architecture> FfmpegSupportedArchitectures = new()
{
Architecture.X64, Architecture.X86, Architecture.Arm64
};
if (!FfmpegSupportedArchitectures.Contains(RuntimeInformation.ProcessArchitecture)
&& FFmpeg.TryGetCliFilePath() is null)
{
// require a manually installed FFmpeg for this architecture
} Try / catch
try
{
await FFmpeg.DownloadAsync(outputPath, progress, ct);
}
catch (PlatformNotSupportedException ex) when (ex.Message.StartsWith("Unsupported architecture"))
{
// instruct the user to install a matching FFmpeg build for their architecture
} Prevention
- Bundle or require a system FFmpeg so the auto-download branch is never taken.
- Gate auto-download on an architecture-capability check.
- Log RuntimeInformation.ProcessArchitecture at startup so unsupported-arch failures are self-diagnosing.
When it happens
Trigger: Calling FFmpeg.DownloadAsync on a process whose RuntimeInformation.ProcessArchitecture is not X64, X86, or Arm64 (e.g. Architecture.Arm, Architecture.Wasm, Architecture.LoongArch64, RiscV64, S390x, Ppc64le). Only reached when auto-download is actually needed (TryGetCliFilePath() returned null).
Common situations: 32-bit ARM SBCs (Raspberry Pi Zero/3 in armhf/armv7 reporting Architecture.Arm); .NET WebAssembly (Architecture.Wasm); RISC-V / LoongArch / s390x / ppc64le Linux; an x86 process running under emulation that reports a translated architecture.
Related errors
AI-assisted analysis of Tyrrrz/YoutubeDownloader@bbcff03951 (2026-08-13).
Data as JSON: /api/errors/5d70f5b226d8c8a0.
Report an issue: GitHub.