Skip to content

florinn/vtt-shift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vtt-shift build badge

Transform stream that shifts WebVTT text tracks by the specified offset.

npm install vtt-shift

Usage

const vttshift = require('vtt-shift')
const fs = require('fs')

const options = { 
    offsetMs: 1000 // offset in milliseconds
}

fs.createReadStream('some-subtitle-file.vtt')
  .pipe(vttshift(options))
  .pipe(fs.createWriteStream('some-subtitle-file-shifted-by-1sec.vtt'))

Command line usage

There is also a command line tool available

npm install -g vtt-shift
vtt-shift --help
vtt-shift some-subtitle-file.vtt --offsetMs=1000 --out=some-subtitle-file-shifted-by-1sec.vtt

License

MIT

About

Time shifting of WebVTT text tracks

Resources

License

Stars

Watchers

Forks

Packages

No packages published