SubtitleEdit/subtitleedit · error · InvalidOperationException
No subtitle tracks in MP4 file: {filePath}
Error message
No subtitle tracks in MP4 file: {filePath} What it means
Thrown by LoadMp4 when a valid MP4 contains no subtitle tracks that yielded paragraphs — every candidate track either had zero paragraphs (GetParagraphs() empty, skipped at line 365) or was filtered out, leaving the tracks list empty. The MP4 itself is valid but carries no extractable subtitle content.
Source
Thrown at src/seconv/Core/ContainerSubtitleLoader.cs:378
}
continue;
}
var paragraphs = track.Mdia.Minf.Stbl.GetParagraphs();
if (paragraphs.Count == 0)
{
continue;
}
var subtitle = new Subtitle();
subtitle.Paragraphs.AddRange(paragraphs);
subtitle.Renumber();
var lang = LanguageAutoDetect.AutoDetectGoogleLanguageOrNull(subtitle) ?? string.Empty;
tracks.Add(new LoadedTrack(subtitle, new SubRip(), lang, trackId));
}
if (tracks.Count == 0)
{
throw new InvalidOperationException($"No subtitle tracks in MP4 file: {filePath}");
}
return tracks;
}
private static List<LoadedTrack> LoadMcc(string filePath)
{
var mcc = new MacCaption10();
if (!mcc.IsMine(null, filePath))
{
throw new InvalidOperationException($"File is not a valid MCC subtitle: {filePath}");
}
var subtitle = new Subtitle();
mcc.LoadSubtitle(subtitle, null, filePath);
subtitle.Renumber();
return [new LoadedTrack(subtitle, mcc, string.Empty, null)];
}
private static List<LoadedTrack> LoadBluRaySup(string filePath, ConversionOptions options)View on GitHub (pinned to 17a9f07487)
Solutions
- Inspect tracks with mp4box -info / ffprobe to confirm a subtitle track exists with samples.
- If subtitles are external, pass the .srt/.vtt file directly.
- For DASH/CMAF, ensure both init and media segments are present and concatenated.
Defensive patterns
Strategy: validation
Validate before calling
// Use ffprobe/the MP4 parser to confirm a subtitle track with samples exists. // (Internal route: only files >10KB or >100 bytes reach LoadMp4 — keep inputs complete.)
Try / catch
try { tracks = ContainerSubtitleLoader.TryLoadTracks(filePath, options); }
catch (InvalidOperationException ex) when (ex.Message.Contains("No subtitle tracks in MP4"))
{ Console.Error.WriteLine(ex.Message); return; } Prevention
- Inspect MP4 tracks with mp4box/ffprobe to confirm subtitle samples exist.
- For DASH/CMAF, concatenate init + media segments before loading.
- Provide external subtitles when the MP4 has none embedded.
When it happens
Trigger: Loading a .mp4/.m4v/.m4s/.3gp where no track is a subtitle track, or all subtitle tracks have empty sample tables (ContainerSubtitleLoader.cs:376). Also reached when the MP4 parser found no 'text'/'subp' handler tracks.
Common situations: A video-only MP4; an MP4 with subtitle tracks whose sample data is missing/empty; a DASH/CMAF segment without its subtitle track; an MP4 whose subtitles are in an unsupported codec.
Related errors
- No VobSub subpictures found in MP4 track.
- Failed to parse MXF file '{filePath}': {ex.Message}
- No subtitle essences found in MXF: {filePath}
- MXF contained {subtitleTexts.Count} candidate subtitle essen
- No subtitle tracks in Matroska file: {filePath}
AI-assisted analysis of SubtitleEdit/subtitleedit@17a9f07487 (2026-08-13).
Data as JSON: /api/errors/953399730742f42c.
Report an issue: GitHub.