{"record":{"id":"5d70f5b226d8c8a0","repo":"Tyrrrz/YoutubeDownloader","slug":"unsupported-architecture-runtimeinformation-proc","errorCode":null,"errorMessage":"Unsupported architecture: {RuntimeInformation.ProcessArchitecture}.","messagePattern":"Unsupported architecture: (.+?)\\.","errorType":"exception","errorClass":"PlatformNotSupportedException","httpStatus":null,"severity":"error","filePath":"YoutubeDownloader.Core/Downloading/FFmpeg.cs","lineNumber":102,"sourceCode":"\n            if (OperatingSystem.IsMacOS())\n                return \"osx\";\n\n            throw new PlatformNotSupportedException(\"Unsupported operating system.\");\n        }\n\n        static string GetArchitectureMoniker()\n        {\n            if (RuntimeInformation.ProcessArchitecture == Architecture.X64)\n                return \"x64\";\n\n            if (RuntimeInformation.ProcessArchitecture == Architecture.X86)\n                return \"x86\";\n\n            if (RuntimeInformation.ProcessArchitecture == Architecture.Arm64)\n                return \"arm64\";\n\n            throw new PlatformNotSupportedException(\n                $\"Unsupported architecture: {RuntimeInformation.ProcessArchitecture}.\"\n            );\n        }\n\n        var sys = GetSystemMoniker();\n        var arch = GetArchitectureMoniker();\n\n        return $\"https://github.com/Tyrrrz/FFmpegBin/releases/download/{Version}/ffmpeg-{sys}-{arch}.zip\";\n    }\n\n    public static async Task DownloadAsync(\n        string outputFilePath,\n        IProgress<Percentage>? progress = null,\n        CancellationToken cancellationToken = default\n    )\n    {\n        var archiveFilePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName() + \".zip\");\n","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/Tyrrrz/YoutubeDownloader/blob/bbcff039515a2ac985e3769f0243a58645a52b28/YoutubeDownloader.Core/Downloading/FFmpeg.cs#L84-L120","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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()."],"exampleFix":"// before: auto-download fails on armhf (Architecture.Arm)\nawait FFmpeg.DownloadAsync(outputPath, progress, ct);\n\n// after: prefer a distro-provided binary and pass it explicitly\nvar ffmpeg = FFmpeg.TryGetCliFilePath() ?? \"ffmpeg\";\nawait downloader.DownloadVideoAsync(filePath, video, option, ffmpegPath: ffmpeg, progress: progress, cancellationToken: ct);","handlingStrategy":"validation","validationCode":"static readonly HashSet<Architecture> FfmpegSupportedArchitectures = new()\n{\n    Architecture.X64, Architecture.X86, Architecture.Arm64\n};\n\nif (!FfmpegSupportedArchitectures.Contains(RuntimeInformation.ProcessArchitecture)\n    && FFmpeg.TryGetCliFilePath() is null)\n{\n    // require a manually installed FFmpeg for this architecture\n}","typeGuard":null,"tryCatchPattern":"try\n{\n    await FFmpeg.DownloadAsync(outputPath, progress, ct);\n}\ncatch (PlatformNotSupportedException ex) when (ex.Message.StartsWith(\"Unsupported architecture\"))\n{\n    // instruct the user to install a matching FFmpeg build for their architecture\n}","preventionTips":["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."],"tags":["platform","ffmpeg","architecture","runtime","arm","wasm"],"backgroundTag":null,"analyzedSha":"bbcff039515a2ac985e3769f0243a58645a52b28","analyzedAt":"2026-08-13T14:28:37.801Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}