WebVTT in MP4

As you probably know from my previous posts, MPEG is standardizing a way to deliver WebVTT files as streams (or tracks) in the ISO Base Media File Format (e.g. MP4 files). The standard is still at draft stage but I recently added VTT-in-MP4 support to GPAC (no playback support yet), as reported in the contribution below. Not that this support might change in the future depending on how the draft standard progresses, in particular in response to some comments we’ve made, as reported in the contribution referenced in this post.

MP4Box now supports basic operations on WebVTT files according to the ISO/IEC 14496-30 DIS and ISO/IEC 14496-12:2012/DAM2. Different files have been tested (regular movie files, chapter files with nested cues, metadata files with XML, and some files with invalid syntax). Here are the basic operations:

Operation

Command line example

Notes

WebVTT Import MP4Box -add file.vtt file.mp4 Adds a track to the given file:

  • Overlapping cues are split into non-overlapping cues and stored in samples
  • Comments and in-between cues text are ignored (for now)

MP4Box -add file.vtt:lang=en:text_layout=800x600x100x100 file.mp4

Sets the language and track layout information

MP4Box -add file.vtt:delay=1000 file.mp4

Adds an edit list

MP4Box -add file.vtt:dur=20 file.mp4

Import only a certain duration of the input file
SRT Import as WebVTT track MP4Box -add file.srt:FMT=VTT file.mp4 Forces the import of SRT files to generate a WebVTT track instead of a 3GPP Timed Text track
WebVTT Export MP4Box –raw <trackId> file.mp4 Exports a WebVTT file where consecutive cues from different samples and with the same id, settings and payload are merged
MP4Box –raw <trackId>:vttnomerge file.mp4 Dump samples as-is w/o merge, and with empty samples
MP4Box –raws <trackId>:<sampleNumber> file.mp4  Exports only one VTT sample
File Editing

MP4Box –split-chunk start:end file.mp4

Split a track into 2 files

MP4Box –cat file1.mp4 –cat file2.mp4 file3.mp4

Concatenation of tracks (second header is ignored)
DASH

MP4Box –frag 1000 file.mp4

MP4Box –dash 1000 file.mp4

Fragments and segments the file and produces an MPD containing:

<Representation id=”1″ mimeType=”video/mp4″ codecs=”wvtt” width=”800″ height=”600″ startWithSAP=”1″ bandwidth=”1939″>


3 thoughts on “WebVTT in MP4”

Leave a Reply

Your email address will not be published. Required fields are marked *