This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
A simple bash script for splitting a video file using [ffmpeg](https://ffmpeg.org) into sections, saving each section in an individual file, and also extracting audio from each video into a separate "mp3" (320kbps bitrate is enforced).
Note: the script splits the video and transcodes the sections to 1280x720p (with the original audio preserved). You can override this behaviour by using `--no-transcode` flag.
By default, the script skips every other section starting from the first one. You can override this behaviour by using `--no-skip` flag. For example if you pass 2 break times (with `-t` flag) to the script, sections 1 and 3 will be skipped as shown below:
`jnk_cutter` is a simple script and just needs the following tools to work:
* bc (optional)
You should be able to run the script in any environment with `bash` and `ffmpeg` support. We test the script on Ubuntu 22.04 and Cygwin 3.4.
* See help
* Just validate the input flags and print the ffmpeg commands but do not execute them
* Cut input.mp4 into a single section: form the 1-min mark to the end. The output files will be named: input_1.mp3, input_1.mp4
`./jnk_cutter.sh -i input.mp4 -t 00:01:00`
* Cut input.mp4 into a single section: form the 1-min mark to the end (similar to the example above). Depending on the frequency of key frames in the original video, a few seconds at the start of output video may appear frozen/corrupted!
* 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`
* 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`
*`12.3` (will be interpreted as 00h 00m 12s 300ms)
*`1:23` (will be interpreted as 00h 01m 23s)
*`1:2:3` (will be interpreted as 01h 02m 03s)
See [ffmpeg documentation](https://ffmpeg.org/ffmpeg-utils.html#Time-duration) for details on the time definition formats. `jnk_cutter` currently does not support the ffmpeg time duration formats which include `s|ms|us` suffixes and/or negative durations `-`.