Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hogart/vtt2srt


https://github.com/hogart/vtt2srt

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# vtt2srt

[WebVTT](http://en.wikipedia.org/wiki/SubRip#WebVTT) to [.srt](http://en.wikipedia.org/wiki/SubRip#SubRip_text_file_format) converter. Sometimes bad internet connection leaves you no option but to download some videos instead of watching them in your browser. But those videos often come with closed captions in WebVTT, and this format is not widely supported in media players yet.

## Installation

`npm install vtt2srt`

`bower install vtt2srt`

Or download and include vtt2srt.js manually in your page.

## Programmatic usage

```javascript
var fs = require('fs');
var vtt2srt = require('vtt2srt');

var vtt = fs.readFile('captions.vtt', function (err, captionsBuff) {
console.log(vtt2srt(vtt));
});
```

## Commandline converter

```
node bin/convert.js < elephants_dream.vtt > elephants_dream.srt
```