Function Repository Resource:

ImportVTT

Source Notebook

Import Web Video Text Tracks (.vtt) data

Contributed by: Jon McLoone

ResourceFunction["ImportVTT"][path]

imports a .vtt file to a Dataset of values.

Details and Options

This is a minimal implementation suitable for the VTT files generated by Zoom meeting transcriptions. It does not support stylesheets, inline styling, positioning, comments or multi-line captions.

Examples

Basic Examples (1) 

Import a simple .vtt file:

In[1]:=
Export["example.vtt",
  "WEBVTT
1
00:00:00.480 --> 00:00:01.530
Jon McLoone: We are recording now.

2
00:00:03.480 --> 00:00:04.500
Jon McLoone: I have something to tell you.

3
00:00:06.990 --> 00:00:14.580
Fred Smith: Do tell!", "String"];
In[2]:=
ResourceFunction["ImportVTT"]["example.vtt"]
Out[2]=

Options (2) 

Often, VTT files hold a separate record for each phrase spoken:

In[3]:=
ResourceFunction["ImportVTT"]["example.vtt"]
Out[3]=

You can catenate consecutive phrases by the same speaker to make transcriptions easier to follow:

In[4]:=
ResourceFunction["ImportVTT"]["example.vtt", "Simplify" -> True]
Out[4]=

Publisher

Jon McLoone

Version History

  • 1.0.0 – 27 September 2021

License Information