A simple script for splitting video files using ffmpeg
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jnktn tv 1fe647edc4 add link to ffmpeg 1 week ago
tests fix grep 3 weeks ago
.gitlab-ci.yml fix output-prefix with ext 1 week ago
LICENSE initial commit 4 weeks ago
README.md add link to ffmpeg 1 week ago
jnk_cutter.sh fix no output ext 1 week ago

README.md

A simple bash script for splitting a video file using ffmpeg into sections, saving each section in an individual file, and also extracting audio from each video into a separate "mp3".

Note: As the script tries to split the video without transcoding, depending on the frequency of key frames in the input file, a few seconds of extra padding at the start of each section might be necessary.

Usage

  • See help

./jnk_cutter -h

  • Cut input.mp4 into two sections: from the start to the 1-min mark and form the 1-min mark to the end. The output files will be: input_0.mp3, input_0.mp4, input_1.mp3, input_1.mp4

./jnk_cutter -i input.mp4 -t 00:01:00 --no-skip

  • Same as the above but change the output file names to output_*.mp3/mp4. You can define the prefix with a different file extension if you want to change the data container e.g. --output-prefix=output.mkv

./jnk_cutter -i input.mp4 --output-prefix=output -t 00:01:00 --no-skip

  • Same as the above but change the output file names to file1.mp3/mp4 & file2.mp3/mp4. (File names which include space or single quotation, must be enclosed in double quotation marks as: --output-files="file 1,file's2") You can define the filenames with a different extension if you want to change the data container e.g. --output-files=file1.mkv,file2.mp4

./jnk_cutter -i input.mp4 --output-files=file1,file2 -t 00:01:00 --no-skip

  • Split the files by defining multiple break points. (output files: start -> 01:00, 01:00 -> 02:00, 02:00 -> 03:00, 03:00 -> end)

./jnk_cutter -i input.mp4 -t 00:01:00 -t 00:02:00 -t 00:03:00 --no-skip

  • Split the files by defining multiple break points skipping every other section. (output files: 01:00 -> 02:00, 03:00 -> end)

./jnk_cutter -i input.mp4 -t 00:01:00 -t 00:02:00 -t 00:03:00

  • Split the files by defining multiple break points skipping only the sections 0&3. (output files: 01:00 -> 02:00, 02:00 -> 03:00)

./jnk_cutter -i input.mp4 -t 00:01:00 -t 00:02:00 -t 00:03:00 --skip=0,3

License

Copyright 2021 https://jnktn.tv

Release under the terms of BSD-3-Clause (see LICENSE)

CLI parser generated using Argbash v2.9.0 (BSD-3-Clause)