GitXplorerGitXplorer
l

vtt-json

public
11 stars
0 forks
0 issues

Commits

List of commits on branch 0.0.x.
Unverified
da03edd3c06755ce8dab554e74b6ee509900717d

Fix millisecond bug.

llinclark committed 10 years ago
Unverified
605cc00224bf6f2b4606e0c31fd2729dbaecfdb5

Add serializer.

llinclark committed 10 years ago
Unverified
16ad22885cee2c7cfd9eacd3c36eb722fbc3b6c0

Minor fixes.

llinclark committed 10 years ago
Unverified
871d88e4f14e840a045c617f66e752418abac8df

Add command line usage.

llinclark committed 10 years ago
Unverified
e51ca77d5fff9bfa35a24eb7b2a1476add1a2f70

Add Usage to README.

llinclark committed 10 years ago
Unverified
249ec15e3fe3aad583f7c7c9ec8cf1cbd02ea434

Add parse method.

llinclark committed 10 years ago

README

The README file for this repository.

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 parser algorithm) and is not meant as an implementation of WebVTT. For that, you should look to the node-vtt project. It also does not validate .vtt files. For that, you should look to the webvtt 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 webvtt—A validator for WebVTT files.