OfficeIMO.Reader.Subtitles
3.6.2
Prefix Reserved
dotnet add package OfficeIMO.Reader.Subtitles --version 3.6.2
NuGet\Install-Package OfficeIMO.Reader.Subtitles -Version 3.6.2
<PackageReference Include="OfficeIMO.Reader.Subtitles" Version="3.6.2" />
<PackageVersion Include="OfficeIMO.Reader.Subtitles" Version="3.6.2" />
<PackageReference Include="OfficeIMO.Reader.Subtitles" />
paket add OfficeIMO.Reader.Subtitles --version 3.6.2
#r "nuget: OfficeIMO.Reader.Subtitles, 3.6.2"
#:package OfficeIMO.Reader.Subtitles@3.6.2
#addin nuget:?package=OfficeIMO.Reader.Subtitles&version=3.6.2
#tool nuget:?package=OfficeIMO.Reader.Subtitles&version=3.6.2
OfficeIMO.Reader.Subtitles
OfficeIMO.Reader.Subtitles adds bounded SubRip (.srt) and WebVTT (.vtt) ingestion to an isolated OfficeDocumentReader.
using OfficeIMO.Reader;
using OfficeIMO.Reader.Subtitles;
OfficeDocumentReader reader = new OfficeDocumentReaderBuilder()
.AddSubtitleHandler(new ReaderSubtitleOptions {
MaxCues = 10_000
})
.Build();
OfficeDocumentReadResult result = reader.ReadDocument("captions.vtt");
foreach (ReaderChunk chunk in result.Chunks) {
Console.WriteLine($"{chunk.Id} lines {chunk.Location.StartLine}-{chunk.Location.EndLine}: {chunk.Text}");
}
Each cue becomes a source-ordered chunk with readable timestamp Markdown, source line locations, and machine-readable start/end milliseconds in metadata. WebVTT NOTE, STYLE, and REGION blocks are skipped; cue markup is stripped by default.
The adapter is local and BCL-only. It does not download media, call YouTube, transcribe audio, run Whisper, or add an audio codec. Applications compose those provider capabilities explicitly outside this package. OfficeIMO.Reader.All registers this handler.
Registration
| Item | Value |
|---|---|
| Handler id | officeimo.reader.subtitles |
| Extensions | .srt, .vtt |
| Reader kind | ReaderInputKind.Text |
| Default input limit | 32 MiB when ReaderOptions.MaxInputBytes is not set |
A file is parsed as WebVTT when it does not have the .srt extension and its first line carries the WEBVTT signature; otherwise it is parsed as SubRip. Text is decoded as UTF-8, honoring a byte-order mark when present.
Options
ReaderSubtitleOptions |
Default | Range | Effect |
|---|---|---|---|
IncludeTimestampsInMarkdown |
true |
Prefixes each cue's Markdown with **hh:mm:ss.fff → hh:mm:ss.fff**. Text never contains the timestamp. |
|
StripCueMarkup |
true |
Removes WebVTT/SRT cue tags (b, i, u, c, v, lang, ruby, rt, span, font and inline timestamps), turns <br> into a line break, and decodes HTML entities. Unrecognized tags are kept. |
|
MaxCues |
50000 |
1 to 1,000,000 | Parsing stops after this many cues. |
MaxCueCharacters |
32000 |
1 to 1,000,000 | Longer cue text is truncated. |
Out-of-range values throw ArgumentOutOfRangeException when the handler is registered. ReaderOptions.MaxChars (default 8000) splits an unusually long cue into continuation chunks.
Output
- Chunks: one per cue, with
Idsubtitle-cue-000000,subtitle-cue-000001, and so on. A cue split byMaxCharscontinues assubtitle-cue-000000-part-0001withContinuesPreviousChunk = true.Locationcarries the cue'sStartLine,EndLine,SourceBlockIndexandSourceBlockKind = "subtitle-cue". Markdown special characters&,<and>are escaped in the Markdown projection. - Document metadata:
subtitle-format(srtorwebvtt) andsubtitle-cue-count. - Cue metadata: one
subtitle.cueentry per cue withValuehh:mm:ss.fff --> hh:mm:ss.fff,SourceObjectIdset to the cue identifier when present, andAttributes["startMilliseconds"]/Attributes["endMilliseconds"].
Limits and diagnostics
| Condition | Result |
|---|---|
| Block with an invalid timing line | Skipped; recoverable subtitle-invalid-block diagnostic naming the line. |
More cues than MaxCues |
Parsing stops; recoverable subtitle-cue-limit diagnostic in the Limit category. |
Cue longer than MaxCueCharacters |
Cue truncated; chunk warning Subtitle cue text was truncated at MaxCueCharacters. |
Cue projection longer than MaxChars |
Cue split; chunk warning Subtitle cue projection was split due to MaxChars. |
| Cue that is empty after markup stripping | Omitted. |
At most 100 parser diagnostics are reported per file.
Example output
WEBVTT
1
00:00:01.000 --> 00:00:03.500
<v Anna>Welcome to the <b>quarterly</b> review.
produces one chunk:
| Property | Value |
|---|---|
Id |
subtitle-cue-000000 |
Text |
Welcome to the quarterly review. |
Markdown |
**00:00:01.000 → 00:00:03.500** followed by a blank line and the cue text |
Location |
lines 3-5, subtitle-cue |
| Cue metadata | 00:00:01.000 --> 00:00:03.500, startMilliseconds = 1000, endMilliseconds = 3500, SourceObjectId = 1 |
Dependency footprint
- External: None.
- OfficeIMO:
OfficeIMO.Reader.Core.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.7.2
- OfficeIMO.Reader.Core (>= 3.6.2)
-
.NETStandard 2.0
- OfficeIMO.Reader.Core (>= 3.6.2)
-
net10.0
- OfficeIMO.Reader.Core (>= 3.6.2)
-
net8.0
- OfficeIMO.Reader.Core (>= 3.6.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on OfficeIMO.Reader.Subtitles:
| Package | Downloads |
|---|---|
|
OfficeIMO.Reader.All
Composition-only preset for registering OfficeIMO.Reader's local format adapters. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.6.2 | 167 | 11/18/2026 |
| 3.6.1 | 230 | 11/10/2026 |
| 3.6.0 | 227 | 11/6/2026 |
| 3.5.3 | 162 | 10/31/2026 |
| 3.5.2 | 155 | 10/24/2026 |
| 3.5.1 | 201 | 10/16/2026 |
| 3.4.5 | 651 | 10/10/2026 |
| 3.4.4 | 305 | 9/27/2026 |
| 3.4.3 | 315 | 9/12/2026 |
| 3.4.2 | 228 | 9/9/2026 |
| 3.4.1 | 234 | 9/7/2026 |
| 3.4.0 | 188 | 9/6/2026 |
| 3.3.0 | 164 | 9/2/2026 |
| 3.2.7 | 157 | 8/29/2026 |
| 3.2.6 | 255 | 8/22/2026 |
| 3.2.5 | 263 | 8/21/2026 |
| 3.2.4 | 246 | 8/19/2026 |
| 3.2.3 | 168 | 8/17/2026 |
| 3.2.2 | 373 | 8/13/2026 |
| 3.2.1 | 297 | 8/11/2026 |