# cut-cat is a minimal video editing bash script that relies on ffmpeg.
# It was developed to edit videos quickly without transcoding, but the ffmpeg
# options could easily be changed to support transcoding. The primary goals
# are speed, ease of use, and stability. Most Linux GUI video editing software
# crashes far too often and point/click/drag/repeat inefficiency seems to slow
# down many simple editing tasks. Input files are not modified. Start and end
# times may not be exact without transcoding in ffmpeg. Things may not work
# properly with different video formats from different sources without
# transcoding. It works great with the H.264/AAC/.mp4 video from my HTC One
# and my GoPro.
#
# cut-cat was inspired by
# http://superuser.com/questions/133413/joining-h264-without-re-encoding
# and developed with ffmpeg version 2.1.4 on Fedora 20. It was developed
# on Linux, but it should work on any platform with bash and ffmpeg like
# MacOS X, Solaris, BSD, etc.
#
# usage information
# cut input_video [optional start time] [optional end time]
# cat output_video
Here is an example project.sh script that uses cut-cat. Just run the project.sh script in the same directory as the cut-cat.sh script to assemble the output video.
#!/bin/bash
. cut-cat.sh # source the cut-cat script
cut video1.mp4 # use entire video
cut video2.mp4 13 22 # second syntax
cut video2.mp4 1:33 01:59 # minute syntax
cut video3.mp4 0:0:58 00:01:56 # hour syntax
cut video3.mp4 2:38 # use last part of video
cat project.mp4 # concatenate all of the cuts
The Casio didn't use AAC for the audio, so that portion of the first non-transcoded output video didn't have any sound. The quick fix was to transcode just the audio of the Casio file, to match the audio codec, channels, and sample rate of the other videos, before editing with cut-cat.
The output video played fine using various local media players. Amazingly, YouTube uploaded the video, but processing definitely choked on the non-transcoded dis.mp4 output video. If the embedded play doesn't work, reload and try "Watch on YouTube.com".