SubtitleEdit/subtitleedit · error · InvalidOperationException

MXF contains {images.Count} image essence(s) but no text sub

Error message

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.

What it means

Thrown when an MXF parses successfully and contains image essences (e.g. PNG subtitle planes) but zero text subtitle essences. seconv cannot use image-based MXF subtitles because MxfParser does not reconstruct per-essence PTS, so the bitmaps have no timing. This is a deliberate 'not yet supported' guard rather than a data-corruption error.

Source

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

            throw new InvalidOperationException(
                $"Failed to parse MXF file '{filePath}': {ex.Message}", ex);
        }

        if (!parser.IsValid)
        {
            // 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

View on GitHub (pinned to 17a9f07487)

Solutions

  1. Use a tool that can extract the MXF image essences with their timing (e.g. FFmpeg's MXF/subtitle demuxer) and feed the extracted format to seconv instead.
  2. Demux the subtitles to a supported image format (.sup/.sub+.idx) first, then run seconv on that.
  3. Request/await per-essence PTS support in the MXF parser; until then this input type is unsupported.
Defensive patterns

Strategy: validation

Validate before calling

// Use a separate probe to detect image-only MXF before converting.
// (No public pre-check in seconv; rely on the exception message containing 'image essence'.)
if (!File.Exists(mxfPath)) return;
// Proceed; the guard inside the loader is the authoritative check.

Try / catch

try { tracks = ContainerSubtitleLoader.TryLoadTracks(mxfPath, options); }
catch (InvalidOperationException ex) when (ex.Message.Contains("Image-based MXF subtitles"))
{ Console.Error.WriteLine("Unsupported image-based MXF subtitles; demux to .sup first."); return; }

Prevention

When it happens

Trigger: Loading an MXF whose GetSubtitles() returns an empty list while GetImages() returns one or more PNG/image essences (ContainerSubtitleLoader.cs:170-175). Typical of MXF wrappers carrying image-based (bitmap) subtitle tracks instead of text.

Common situations: Broadcast/studio MXF masters with image subtitles (e.g. DVB-style bitmap captions wrapped in MXF); content authored for systems that store subtitles as PNG planes; trying to convert such a file before the parser gains PTS reconstruction.

Related errors


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