SubtitleEdit/subtitleedit · error · InvalidOperationException

Track is empty.

Error message

Track is empty.

What it means

Thrown by ConvertTrackAsync when a container-extracted track (MKV/MP4/TS text track) loaded successfully but contains zero paragraphs. Distinct from error 143: the track metadata exists, the Subtitle object is non-null, but it has no cues.

Source

Thrown at src/seconv/Core/SubtitleConverter.cs:671

            Configuration.Settings.General.CurrentFrameRate = originalFrameRate;
        }
    }

    private async Task ConvertTrackAsync(ContainerSubtitleLoader.LoadedTrack track, string outputFile, ConversionOptions options)
    {
        var originalFrameRate = Configuration.Settings.General.CurrentFrameRate;
        try
        {
            if (options.Fps.HasValue)
            {
                Configuration.Settings.General.CurrentFrameRate = options.Fps.Value;
            }

            await Task.Run(async () =>
            {
                if (track.Subtitle.Paragraphs.Count == 0)
                {
                    throw new InvalidOperationException("Track is empty.");
                }

                await ApplyTransformsAndSaveAsync(track.Subtitle, track.Format, outputFile, options);
            });
        }
        finally
        {
            Configuration.Settings.General.CurrentFrameRate = originalFrameRate;
        }
    }

    private async Task ApplyTransformsAndSaveAsync(Subtitle subtitle, SubtitleFormat sourceFormat, string outputFile, ConversionOptions options)
    {
        // Apply offset (must be first, before any time-based transforms)
        if (options.Offset.HasValue && options.Offset.Value != TimeSpan.Zero)
        {
            subtitle.AddTimeToAllParagraphs(options.Offset.Value);
        }

View on GitHub (pinned to 17a9f07487)

Solutions

  1. Inspect the container's track list (seconv info or ffprobe) and pick a track that actually carries cues.
  2. Drop --forced-only if the selected track only has non-forced entries.
  3. Re-extract or re-mux the source if the track is unexpectedly empty.

Example fix

// before
seconv movie.mkv srt --forced-only   // track has no forced cues
// after
seconv movie.mkv srt
Defensive patterns

Strategy: validation

Validate before calling

// After loading a container track
if (track.Subtitle.Paragraphs.Count == 0) {
    warnings.Add($"Track #{track.TrackNumber} is empty; skipping.");
    continue;
}

Type guard

static bool TrackHasCues(ContainerSubtitleLoader.LoadedTrack t) => t.Subtitle.Paragraphs.Count > 0;

Try / catch

null

Prevention

When it happens

Trigger: ContainerSubtitleLoader.LoadedTrack.Subtitle.Paragraphs.Count == 0 inside the Task.Run body of ConvertTrackAsync. The track was selected (matches --track-number / not filtered) but yielded no cues.

Common situations: A container track flagged in metadata but with no actual subtitle packets (e.g. a placeholder/empty language track in an MKV), or a forced-only track that has no forced entries when --forced-only is set.

Related errors


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