Source Window — a new After Effects tool from AENural. Explore →
Subtitle Tutorials

SRT to JSON: Understand Timestamp Fields Before Using the Data

SRT-to-JSON conversion turns subtitle cues into structured records, but there is no single universal subtitle JSON schema. Inspect the actual fields and time units before importing them. AENural's export includes formatted start/end strings plus integer startMs/endMs values, so your application can avoid guessing whether a number means seconds or milliseconds.

AENural
In this guide

Inspect one record before the full file

Illustrative AENural export record
[{
  "index": 1,
  "start": "00:00:02,000",
  "end": "00:00:04,500",
  "startMs": 2000,
  "endMs": 4500,
  "text": "Keep the timing units explicit."
}]

In this record, the duration is 4500 − 2000 = 2500 milliseconds, or 2.5 seconds. A player API expecting seconds would need 2 and 4.5, not 2000 and 4500. Store the unit in your data contract, not only in a developer's memory.

The JSON specification defines JSON syntax and interoperability, not a subtitle field vocabulary. Another converter might return arrays, decimal seconds or a different naming scheme. Valid JSON is not proof that two applications agree about its meaning.

Convert using AENural's actual controls

  1. Open SRT to JSON, select Choose SRT file and choose your reviewed subtitle copy. The input accepts up to 10 MB and 10,000 cues.
  2. Wait for JSON ready. Compare its cue-object count with your source, then inspect JSON array. An SRT cue starting at two seconds should show startMs as 2000, alongside its formatted start time.
  3. Select Copy JSON to paste the displayed array into your application, or Download JSON to save a file. If copying fails, download instead and parse that file.
  4. Test one multiline caption and one with quotation marks. In the JSON source, escaped newline and quote characters are syntax; a JSON parser reconstructs their text values.

There is no schema selector on this converter. If your integration expects an object containing a cues property, wrap or map the parsed array intentionally. Do not assume a file called subtitles.json matches another service's contract. Confirm the required field names before importing a long recording.

Export and compare the structured data

  1. Parse the downloaded JSON with a real JSON parser, not a line-by-line text splitter.
  2. Compare cue count, first/last times, text and line breaks with the original.
  3. Document required fields and units before passing the data to another system.

AENural's current export regenerates sequential index values and retains the caption text as a string. A numeric index is an export position, not a permanent identity guaranteed to survive later splitting, merging or reordering. Use your own stable identifiers if your application needs revision tracking.

Validate at the receiving boundary

Checks before accepting subtitle records
Field or relationshipExpected check
startMs/endMsFinite, non-negative integers with endMs greater than startMs.
TextA string with useful caption content; preserve intended line breaks.
Record orderConsistent with the timeline your application expects.
Duration unitsDeclared and converted exactly once.
Extra markupTreated as text unless a safe renderer explicitly supports it.

For playback in seconds, divide integer milliseconds by 1000 once. Test a fractional boundary such as 1250 milliseconds; it should become 1.25 seconds, not 1250 seconds or a rounded one-second value.

Do not inject subtitle strings directly as HTML. Captions can contain angle brackets, quoted text or markup-like content. Render plain text by default and intentionally handle only the formatting your product supports. Escaping JSON syntax does not make text safe for every downstream context.

Keep the original for round trips

A flat JSON export of text and timing is useful for review tools, search and integrations. It does not necessarily preserve every source-file feature, and a receiving application may not accept it as a caption upload. Use the destination's requested format rather than assuming JSON replaces SRT or VTT everywhere.

  • Test one multiline cue and one cue with quotation marks.
  • Compare exact millisecond values after import.
  • Preserve Unicode text and punctuation.
  • Keep the original timed file and your schema notes together.

For a standard web caption track, use SRT to VTT. For structured application data, use JSON with a documented contract. Those outputs solve different problems even when they start from the same captions.

Subtitle JSON integration questions

Why won't a JSON subtitle file open in my normal video player?

JSON is structured data, not a universally supported subtitle track. Identify its schema and the receiving application's requirements. Use a supported SRT or VTT export for ordinary subtitle playback when required.

Why does a script accept one subtitle JSON file and reject another?

Different producers use different field names, nesting and time units. Inspect the actual file and map its schema explicitly. A .json extension does not establish compatibility with another producer's caption data.

Are AENural's startMs and endMs values seconds or milliseconds?

They are integer milliseconds. For example, 1,250 means 1.25 seconds. Check the formatted start/end strings alongside those values before connecting an animation or player that expects seconds.

Can I feed YouTube's caption JSON directly into a converter expecting AENural JSON?

Do not assume so. YouTube's internal caption structures can differ from AENural's cue records. Inspect the required input contract and use an authorized export rather than renaming fields without understanding their meaning.

Does SRT-to-JSON give me exact timing for every word?

No. It structures the cue boundaries already present in the SRT. A phrase-level time range does not locate every spoken word. Measure or obtain word timing separately when an effect needs it.

Why do rolling captions produce duplicated text in my data?

Some sources repeat earlier words as each caption updates. Compare successive cues and the recording before deduplicating. Removing every repeated string can also delete intentional repetition or speaker dialogue.

Should my JSON parser assume every cue has the same fields as a sample?

Validate the actual export and handle missing or unexpected values deliberately. Check text, start/end order and units. Keep a small known-good fixture to distinguish a schema error from malformed source subtitles.

Can JSON carry speaker names if the SRT does not contain them?

Conversion cannot identify speakers from missing information. Preserve verified names already written in the text, or add a separately reviewed speaker mapping. Do not invent identity fields merely to satisfy an application schema.

Will changing JSON timestamps alter my original subtitle file?

A separate JSON edit does not update the SRT master automatically. Keep one reviewed source and track derived versions. Reconcile corrections explicitly before exporting another file for playback or delivery.

How can I check the export before importing thousands of cues?

Convert a short reviewed SRT, inspect the opening and closing records, and compare their text and millisecond values with the source. Test that fixture in the receiving application before using the complete file.