SubtitleEdit/subtitleedit · error · InvalidOperationException

No Blu-Ray sup subtitles found in: {filePath}

Error message

No Blu-Ray sup subtitles found in: {filePath}

What it means

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).

Source

Thrown at src/seconv/Core/BitmapSubtitleLoader.cs:53

        int? ScreenWidth = null,
        int? ScreenHeight = null,
        SKPointI? Position = null) : IDisposable
    {
        public void Dispose() => Bitmap.Dispose();
    }

    /// <summary>
    /// Blu-Ray .sup file → bitmap events. PcsData times are 90 kHz ticks; divide
    /// by 90 for milliseconds. The PCS header's Width/Height carry the source video
    /// dimensions (typically 1920x1080 or 1280x720).
    /// </summary>
    public static IReadOnlyList<BitmapSubtitleItem> LoadBluRaySup(string filePath)
    {
        var log = new StringBuilder();
        var pcsList = BluRaySupParser.ParseBluRaySup(filePath, log);
        if (pcsList.Count == 0)
        {
            throw new InvalidOperationException($"No Blu-Ray sup subtitles found in: {filePath}");
        }
        return PcsListToItems(pcsList);
    }

    /// <summary>
    /// MKV PGS track (S_HDMV/PGS) → bitmap events. PGS-in-MKV is the same PCS payload
    /// as a .sup file, just wrapped in Matroska block timing.
    /// </summary>
    public static IReadOnlyList<BitmapSubtitleItem> LoadMatroskaPgs(MatroskaFile matroska, MatroskaTrackInfo track)
    {
        var pcsList = BluRaySupParser.ParseBluRaySupFromMatroska(track, matroska);
        if (pcsList.Count == 0)
        {
            throw new InvalidOperationException($"No PGS subtitles in MKV track #{track.TrackNumber}.");
        }
        return PcsListToItems(pcsList);
    }

View on GitHub (pinned to 17a9f07487)

Solutions

  1. Verify the file is actually a Blu-Ray .sup (PGS) — check magic bytes / first segment header.
  2. Re-demux the PGS from the source MKV/Blu-Ray with mkvextract or a Blu-Ray tool.
  3. If the file is another bitmap format, call the matching loader (LoadVobSub, LoadMatroskaPgs).

Example fix

// before
if (pcsList.Count == 0)
    throw new InvalidOperationException($"No Blu-Ray sup subtitles found in: {filePath}");

// after
if (pcsList.Count == 0)
    throw new InvalidOperationException($"No Blu-Ray sup subtitles found in '{filePath}'. Parser log: {log}");
Defensive patterns

Strategy: validation

Validate before calling

static bool IsBluRaySup(string path)
{
    if (!File.Exists(path) || new FileInfo(path).Length < 16) return false;
    using var fs = File.OpenRead(path);
    var buf = new byte[4]; return fs.Read(buf, 0, 4) == 4 && buf[0] == 0x50 && buf[1] == 0x47; // 'PG'
}

Type guard

static bool LooksLikeBluRaySup(string path) => IsBluRaySup(path);

Try / catch

null

Prevention

When it happens

Trigger: 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.

Common situations: Wrong file passed to a 'sup' loader; demux produced an empty PGS track; file copied incompletely.

Related errors


AI-assisted analysis of SubtitleEdit/subtitleedit@17a9f07487 (2026-08-13). Data as JSON: /api/errors/c409ba658b49c5eb. Report an issue: GitHub.