{"record":{"id":"c409ba658b49c5eb","repo":"SubtitleEdit/subtitleedit","slug":"no-blu-ray-sup-subtitles-found-in-filepath","errorCode":null,"errorMessage":"No Blu-Ray sup subtitles found in: {filePath}","messagePattern":"No Blu-Ray sup subtitles found in: (.+?)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/seconv/Core/BitmapSubtitleLoader.cs","lineNumber":53,"sourceCode":"        int? ScreenWidth = null,\n        int? ScreenHeight = null,\n        SKPointI? Position = null) : IDisposable\n    {\n        public void Dispose() => Bitmap.Dispose();\n    }\n\n    /// <summary>\n    /// Blu-Ray .sup file → bitmap events. PcsData times are 90 kHz ticks; divide\n    /// by 90 for milliseconds. The PCS header's Width/Height carry the source video\n    /// dimensions (typically 1920x1080 or 1280x720).\n    /// </summary>\n    public static IReadOnlyList<BitmapSubtitleItem> LoadBluRaySup(string filePath)\n    {\n        var log = new StringBuilder();\n        var pcsList = BluRaySupParser.ParseBluRaySup(filePath, log);\n        if (pcsList.Count == 0)\n        {\n            throw new InvalidOperationException($\"No Blu-Ray sup subtitles found in: {filePath}\");\n        }\n        return PcsListToItems(pcsList);\n    }\n\n    /// <summary>\n    /// MKV PGS track (S_HDMV/PGS) → bitmap events. PGS-in-MKV is the same PCS payload\n    /// as a .sup file, just wrapped in Matroska block timing.\n    /// </summary>\n    public static IReadOnlyList<BitmapSubtitleItem> LoadMatroskaPgs(MatroskaFile matroska, MatroskaTrackInfo track)\n    {\n        var pcsList = BluRaySupParser.ParseBluRaySupFromMatroska(track, matroska);\n        if (pcsList.Count == 0)\n        {\n            throw new InvalidOperationException($\"No PGS subtitles in MKV track #{track.TrackNumber}.\");\n        }\n        return PcsListToItems(pcsList);\n    }\n","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/SubtitleEdit/subtitleedit/blob/17a9f0748781032255db3526b7215d2fb891e3af/src/seconv/Core/BitmapSubtitleLoader.cs#L35-L71","documentation":"InvalidOperationException from LoadBluRaySup: BluRaySupParser.ParseBluRaySup ran on the file but returned zero PCS (Presentation Composition Segment) entries. A real .sup must contain at least one PCS per subtitle event, so an empty list means the file is not a valid Blu-Ray .sup (or is empty/corrupt).","triggerScenarios":"Pointing the bitmap loader at a file that is not a Blu-Ray .sup — e.g. a VobSub .sub, an MKV, a .sup with truncated headers — or a zero-byte file.","commonSituations":"Wrong file passed to a 'sup' loader; demux produced an empty PGS track; file copied incompletely.","solutions":["Verify the file is actually a Blu-Ray .sup (PGS) — check magic bytes / first segment header.","Re-demux the PGS from the source MKV/Blu-Ray with mkvextract or a Blu-Ray tool.","If the file is another bitmap format, call the matching loader (LoadVobSub, LoadMatroskaPgs)."],"exampleFix":"// before\nif (pcsList.Count == 0)\n    throw new InvalidOperationException($\"No Blu-Ray sup subtitles found in: {filePath}\");\n\n// after\nif (pcsList.Count == 0)\n    throw new InvalidOperationException($\"No Blu-Ray sup subtitles found in '{filePath}'. Parser log: {log}\");","handlingStrategy":"validation","validationCode":"static bool IsBluRaySup(string path)\n{\n    if (!File.Exists(path) || new FileInfo(path).Length < 16) return false;\n    using var fs = File.OpenRead(path);\n    var buf = new byte[4]; return fs.Read(buf, 0, 4) == 4 && buf[0] == 0x50 && buf[1] == 0x47; // 'PG'\n}","typeGuard":"static bool LooksLikeBluRaySup(string path) => IsBluRaySup(path);","tryCatchPattern":"null","preventionTips":["Sniff the file magic before dispatching to LoadBluRaySup.","Pick the loader based on extension + magic, not extension alone."],"tags":["subtitles","blu-ray","pgs","file-format","validation"],"backgroundTag":null,"analyzedSha":"17a9f0748781032255db3526b7215d2fb891e3af","analyzedAt":"2026-08-13T18:11:43.374Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}