Easily Split Videos with FFmpeg

Forget iMovie, FFmpeg is the easiest way to take long videos and split them into smaller clips.

Unlike most developers, I actually prefer using GUI's over the command line, but after messing around with iMovie for half an hour, it dawned on me that FFmpeg is much better suited for this task.

If you don't already have FFmpeg installed, the easiest way to get it on your mac is with homebrew. just

    brew install ffmpeg

Then, the magical command is:

    ffmpeg -ss 00:00:05 -t 6 -i input.mov -vcodec copy -acodec copy output.mov

Let's break this down:

  • -ss stands for start time,
  • -t is the length of final clip,
  • -i is the input file, in this case it's a file called 'input.mov'
  • -vcodec is the video codec used to encode the output file. 'copy' means we're using the same codec as the input file.
  • -acodec is the audio codec. Like the video codec, we'll be using the same audio codec as the input file.
  • output.mov is the output file, you can rename this to any file name you choose.