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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OfficeIMO.Reader.Subtitles" Version="3.6.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OfficeIMO.Reader.Subtitles" Version="3.6.2" />
                    
Directory.Packages.props
<PackageReference Include="OfficeIMO.Reader.Subtitles" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OfficeIMO.Reader.Subtitles --version 3.6.2
                    
#r "nuget: OfficeIMO.Reader.Subtitles, 3.6.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OfficeIMO.Reader.Subtitles@3.6.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OfficeIMO.Reader.Subtitles&version=3.6.2
                    
Install as a Cake Addin
#tool nuget:?package=OfficeIMO.Reader.Subtitles&version=3.6.2
                    
Install as a Cake Tool

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 Id subtitle-cue-000000, subtitle-cue-000001, and so on. A cue split by MaxChars continues as subtitle-cue-000000-part-0001 with ContinuesPreviousChunk = true. Location carries the cue's StartLine, EndLine, SourceBlockIndex and SourceBlockKind = "subtitle-cue". Markdown special characters &, < and > are escaped in the Markdown projection.
  • Document metadata: subtitle-format (srt or webvtt) and subtitle-cue-count.
  • Cue metadata: one subtitle.cue entry per cue with Value hh:mm:ss.fff --> hh:mm:ss.fff, SourceObjectId set to the cue identifier when present, and Attributes["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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed