SubtitleEdit/subtitleedit · error · InvalidOperationException

No subtitle essences found in MXF

Error message

No subtitle essences found in MXF: {filePath}

What it means

Thrown when an MXF is valid but contains neither text subtitle essences nor image essences — both GetSubtitles() and GetImages() return empty lists. The file is structurally an MXF but carries no subtitle content at all, so there is nothing to extract.

Solutions

  1. Confirm the MXF actually contains subtitle essences with ffprobe / an MXF inspector.
  2. If subtitles exist in another track/container, target that source instead.
  3. Re-wrap the original to include the subtitle essence.
Defensive patterns

Strategy: validation

Validate before calling

// Probe for subtitle essences with ffprobe before invoking the loader.
// (No direct public API; treat ffprobe output as the validation step.)
var hasSubs = ProbeHasSubtitleEssence(mxfPath);
if (!hasSubs) return Error($"No subtitle essences in {mxfPath}");

Try / catch

try { tracks = ContainerSubtitleLoader.TryLoadTracks(mxfPath, options); }
catch (InvalidOperationException ex) when (ex.Message.Contains("No subtitle essences"))
{ Console.Error.WriteLine(ex.Message); return; }

Prevention

When it happens

Trigger: Loading a valid MXF (parser.IsValid true) where the subtitleTexts list (line 170) is empty and images.Count is also 0 — e.g. a video/audio-only MXF, or one whose subtitle essence was stripped.

Common situations: Pointing seconv at a video-only or audio-only MXF master; an MXF whose subtitle track was removed during re-wrapping; an MXF with an unrecognised/non-subtitle essence that the parser ignores.

Related errors


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

Appendix: source

Thrown at src/seconv/Core/ContainerSubtitleLoader.cs:182

        {
            // Not a real MXF (no Header Partition Pack signature). Fall through to the
            // text loader — the file might just have a misleading extension.
            return null;
        }

        var subtitleTexts = parser.GetSubtitles();
        var images = parser.GetImages();

        if (subtitleTexts.Count == 0)
        {
            if (images.Count > 0)
            {
                throw new InvalidOperationException(
                    $"MXF contains {images.Count} image essence(s) but no text subtitles. "
                    + "Image-based MXF subtitles (PNG essences) aren't supported yet — "
                    + "the parser doesn't reconstruct per-essence PTS, so the bitmaps have no timing.");
            }
            throw new InvalidOperationException($"No subtitle essences found in MXF: {filePath}");
        }

        if (images.Count > 0)
        {
            AnsiConsole.MarkupLine(
                $"[yellow]Note: MXF also contains {images.Count} image essence(s) — skipped (no timing context).[/]");
        }

        var tracks = new List<LoadedTrack>();
        var trackNumber = 1;
        foreach (var subtitleText in subtitleTexts)
        {
            // Honour --track-number against the 1-based essence index — mirrors how
            // LoadMatroska / LoadMp4 filter their multi-track inputs (line ~96).
            if (options.TrackNumbers.Count > 0 && !options.TrackNumbers.Contains(trackNumber))
            {
                trackNumber++;
                continue;

View on GitHub (pinned to 17a9f07487)