Korbs revised this gist 5 days ago. Go to revision
1 file changed, 48 insertions
README.md(file created)
| @@ -0,0 +1,48 @@ | |||
| 1 | + |  | |
| 2 | + | ||
| 3 | + | ## Requirements | |
| 4 | + | - ffmpeg | |
| 5 | + | - NodeJS | |
| 6 | + | ||
| 7 | + | ## Script | |
| 8 | + | ||
| 9 | + | In a new directory, create a file called `generate.js`, then install the `sprite-vtt-generator` package: | |
| 10 | + | ||
| 11 | + | ```bash | |
| 12 | + | npm install sprite-vtt-generator | |
| 13 | + | ``` | |
| 14 | + | ||
| 15 | + | For the `generate.js` file, put in the following: | |
| 16 | + | ||
| 17 | + | ```js | |
| 18 | + | import { SpriteGenerator } from "sprite-vtt-generator" | |
| 19 | + | const spriteGenerator = new SpriteGenerator({ | |
| 20 | + | inputPath: "./video.mp4", | |
| 21 | + | outputDir: "./", | |
| 22 | + | width: 180, | |
| 23 | + | height: 101, | |
| 24 | + | rowCount: 10, | |
| 25 | + | colCount: 5, | |
| 26 | + | multiple: false, | |
| 27 | + | interval: 3, | |
| 28 | + | thumbnailPrefix: "thumb", | |
| 29 | + | webVTT: { | |
| 30 | + | required: true, | |
| 31 | + | path: "./storyboard.vtt" | |
| 32 | + | } | |
| 33 | + | }) | |
| 34 | + | ||
| 35 | + | await spriteGenerator.generate() | |
| 36 | + | ``` | |
| 37 | + | ||
| 38 | + | ## Generate | |
| 39 | + | ||
| 40 | + | Add the video you want to use and rename to `video.mp4` (or change `inputPath` in `generate.js`). | |
| 41 | + | ||
| 42 | + | Then run the script: | |
| 43 | + | ||
| 44 | + | ```bash | |
| 45 | + | node generate.js | |
| 46 | + | ``` | |
| 47 | + | ||
| 48 | + | For testing, I used Ennie and Yoyki full episode, which out as this: https://ocean.sudovanilla.org/media/images/159.jpg | |
Newer
Older