Split an audio or video file by using a srt timing file.
NodeJS
FFmpeg
You will need to have ffmpeg available in your system path. The easiest way to do this is to install the aeneas tools installer which includes ffmpeg.
Clone or download this repository.
Then in a terminal do the following.
cd split-media-by-srt
npm install
npm link
split-media-by-srt -i ~/MyVideo.m4v -s ~/MyVideo.srt -o ~/Segments/ -f aac
Note: This script will only copy the source media codec's content and will not convert to another codec.
short | long | description |
---|---|---|
-v, | --verbose | Display verbose output |
-d, | --debug | Display debug information |
-h, | --help | Display this usage guide |
-i, | --file | The input media file to process (required) |
-s, | --srt | The input srt file to process segments (required) |
-o, | --dir | The output directory to save the segments (required) |
-f, | --fmt | The output format to save the segments (optional) [Default: same as source media] |