Convert Advanced SubStation Alpha (ASS) subtitles to SubRip (SRT). Use captions.ass from the zip.
dotnet add package RecursiveAI.OneMediaRequires .NET 10 (net10.0); .NET 9 and earlier aren’t supported.
using RecursiveAI.OneMedia; var report = Subtitles.Convert( "captions.ass", "captions.srt"); Console.WriteLine(report.IsLossless);
The example is the full program below: unzip it and dotnet run. To run only the code above, paste it into Program.cs of a new dotnet new console project and dotnet run.
FalseThe snippet writes captions.srt; False here only means some ASS styling didn’t carry over.
The full program
These are the dialogue lines from the zip’s captions.ass. The first has an explicit screen position (\pos); the second names the speaker Maya and uses italics (\i1 and \i0).
Dialogue: 0,0:00:00.50,0:00:02.10,Default,,0,0,0,,{\pos(120,80)}Watch the sky. Dialogue: 0,0:00:02.50,0:00:04.00,Default,Maya,0,0,0,,{\i1}There it is!{\i0}
using RecursiveAI.OneMedia; var report = Subtitles.Convert("captions.ass", "captions.srt"); foreach (var loss in report.Losses) Console.WriteLine($"Cue {loss.CueIndex}: {loss.Kind} — {loss.Feature}"); Console.WriteLine(); Console.Write(File.ReadAllText("captions.srt"));
dotnet run prints the losses followed by the new SRT:
Cue -1: Dropped — Styles Cue 0: Dropped — Position Cue 0: Dropped — Styles Cue 1: Dropped — Voice Cue 1: Dropped — Styles 1 00:00:00,500 --> 00:00:02,100 Watch the sky. 2 00:00:02,500 --> 00:00:04,000 <i>There it is!</i>
The report uses zero-based cue indexes (0 for the first cue); -1 here is for the script’s style table, not a dialogue line. If the output already exists, the call throws IOException; pick a new filename.
Variations
Print just the cue indexes for dropped positioning, still writing an SRT file:
using RecursiveAI.OneMedia; using RecursiveAI.OneMedia.Captions; var report = Subtitles.Convert("captions.ass", "review.srt"); foreach (var loss in report.Losses) if (loss.Feature == SubtitleFeatures.Position) Console.WriteLine(loss.CueIndex);
0Related recipes
Convert SRT to WebVTT · Extract subtitles from MKV
The short answer
Use Subtitles.Convert("captions.ass", "captions.srt"). The extension of the new file selects SRT. Read the returned Losses list if the placement or appearance of the text matters: a file can be written successfully without carrying every feature from the ASS script.
How can I convert subtitles to SRT format?
Pass the path to a standalone Advanced SubStation Alpha (ASS) file as the input and a fresh .srt path as the output. The converter reads the dialogue events and writes numbered SRT cues. Renaming the input extension alone won’t work: the file still contains ASS Dialogue: rows instead of numbered blocks with start and end times.
ASS stores cue times in hundredths of a second. SRT writes them in thousandths, so the first cue’s 0:00:00.50 becomes 00:00:00,500, the same half second. The conversion doesn’t shift cues to match a new cut of a video or translate the dialogue. If an ASS track is embedded in a video container, extract the track first; the call above reads the subtitle file, not the video.
What does SRT keep from an ASS file?
The OneMedia subtitle fidelity table distinguishes inline styles, such as italic text, from named style definitions and exact screen positions. In this example, “There it is!” remains italic, but its speaker name is not part of the displayed dialogue and doesn’t appear in the SRT. The first line’s pixel position is dropped. A player might therefore show that line in its usual caption area rather than beside the part of the scene it describes.
Features such as named styles and karaoke word timing aren’t carried into SRT by this converter. Review reported losses in context: losing a position can matter for a translated sign or overlapping dialogue, even if the text and times match. Keep the ASS file if you’ll need the original styling later; converting the SRT back can’t recover details that were dropped.