Easily generate thumbnail sprites along with vtt file. https://www.npmjs.com/package/sprite-vtt-generator
Find a file
2023-04-22 09:22:02 +05:30
.github updated readme 2023-04-22 09:22:02 +05:30
.husky first commit 2022-05-27 13:56:54 +05:30
.vscode first commit 2022-05-27 13:56:54 +05:30
src fix: import issue and input file not found 2023-04-22 09:16:06 +05:30
.dockerignore first commit 2022-05-27 13:56:54 +05:30
.eslintignore first commit 2022-05-27 13:56:54 +05:30
.eslintrc.js added method to find optimal interval 2022-05-27 22:43:26 +05:30
.gitignore first commit 2022-05-27 13:56:54 +05:30
.npmignore updated dockerfile 2022-05-28 19:11:40 +05:30
.nvmrc added readme 2022-05-27 20:40:30 +05:30
.prettierignore first commit 2022-05-27 13:56:54 +05:30
.prettierrc first commit 2022-05-27 13:56:54 +05:30
docker-compose.yml fix: import issue and input file not found 2023-04-22 09:16:06 +05:30
Dockerfile updated dockerfile 2022-05-28 19:11:40 +05:30
jest.config.js first commit 2022-05-27 13:56:54 +05:30
package-lock.json updated dockerfile 2022-05-28 19:11:40 +05:30
package.json fix: import issue and input file not found 2023-04-22 09:16:06 +05:30
readme.md fix: import issue and input file not found 2023-04-22 09:16:06 +05:30
tsconfig.json added readme 2022-05-27 20:40:30 +05:30

Sprite Vtt Generator

Easily generate thumbnail sprites along with vtt file.

Important Note: FFmpeg needs to be installed.

Javascript Example

const { SpriteGenerator } = require("sprite-vtt-generator");

const spriteGenerator = new SpriteGenerator({
  inputPath: './test/test.mp4',
  outputDir: './test/output',
  width: 120, // default 160,
  height: 60, // default 90,
  rowCount: 2, // default 5,
  colCount: 5, // default 5,
  multiple: true, // default false, if true rowCount will be ignored,
  interval: 5, // if not provided optimal interval will be chosen based on video duration,
  thumbnailPrefix: 'img', // default 'thumb',
  webVTT: {
    required: true,
    path: './test/output/test.vtt',
  },
});

spriteGenerator
  .generate()
  .then(() => {
    //do stuff here
  })
  .catch((err) => {
    console.log(err);
  });

Typescript Example

import { SpriteGenerator } from "sprite-vtt-generator";

const spriteGenerator = new SpriteGenerator({
  inputPath: './test/test.mp4',
  outputDir: './test/output',
  width: 120, // default 160,
  height: 60, // default 90,
  rowCount: 2, // default 5,
  colCount: 5, // default 5,
  multiple: true, // default false, if true rowCount will be ignored,
  interval: 5, // if not provided optimal interval will be chosen based on video duration,
  thumbnailPrefix: 'img', // default 'thumb',
  webVTT: {
    required: true,
    path: './test/output/test.vtt',
  },
});

spriteGenerator
  .generate()
  .then(() => {
    //do stuff here
  })
  .catch((err) => {
    console.log(err);
  });