vtt-json

This project parses to JSON and serializes back to the .vtt format, not to HTML. This makes it easy to manipulate the cue timeline (e.g. adding time between two cues).

It does not follow the [http://dev.w3.org/html5/webvtt/#parsing](WebVTT(link is external) parser algorithm) and is not meant as an implementation of WebVTT. For that, you should look to the node-vtt(link is external) project. It also does not validate .vtt files. For that, you should look to the webvtt(link is external) project.

Usage

Pipe example

var fs = require('fs'),
    vtt = require('vtt-json');

var input = fs.createReadStream('input.vtt');
var output = fs.createWriteStream('output.json');

input.pipe(vtt.parse())
    .pipe(through2.obj(function(obj, enc, cb) {
        cb(null, JSON.stringify(obj, null, '\t'))
    }))
    .pipe(output);

Command line tool

Files can also be converted from .vtt to JSON on the command line.

vtt-json parse input.vtt --output=output.json

Related projects

node-vtt(link is external)
webvtt(link is external)—A validator for WebVTT files.

Rating

0 out of 5 Stars 0 Review

5 Stars
 
0.00%
4 Stars
 
0.00%
3 Stars
 
0.00%
2 Stars
 
0.00%
1 Star
 
0.00%

About

  • There are no comments yet

Thank you! Review submitted.

Ok