media-splitter
v0.1.11
Published
the library to split media file like video and audio
Downloads
4
Readme
media-splitter
The library to split media file like video and audio
Installation
You need to install ffmpeg
to use this package.
$ brew install ffmpeg
Install npm package if you use this package in Node.js.
# as a local package
$ npm install media-splitter
# as a global package
$ npm install -g media-splitter
Usage
Node.js
You can use it by import.
import { splitMedia } from "media-splitter";
splitMedia({
inputFile: "./sample.mp4",
outputDir: "./dist",
outputFileName: (index, defaultName) => `${defaultName}-${index}`,
splitDurationMs: 600,
});
CLI Command
You can also use it by command.
$ npx media-splitter -i ./sample.mp4
Options
- -i, --input file path of media
- -o, --output directory path of output (default: "./media-splitter-dist")
- -n, --name name of output file, it's assigned sequential numbers automatically
- -s, --split duration to split media file (default: "600")
- -h, --help display help for command