Cutting a part from a video with FFmpeg

FFmpeg allows you to choose a start time for a video and a finish time or duration and it will chop that part out and save it. There are two ways to do this, the first will cut the video and do no re-encoding, meaning it will be quick but the video most likely will be large and uncompressed. The second method will do a cut and re-encode, taking longer but compressing the file.

Cut with no re-encoding, quickest!

ffmpeg -ss 01:20:44 -i input.mp4 -t 00:02:00  -c copy output.mp4

The above command will make a 2 minute file called output.mp4 running from 1 hour, 20 minutes and 44 seconds through to 1 hour, 22 minutes and 44 seconds from input.mp4.

Cut with re-encoding, smaller file but longer time

ffmpeg -ss 01:20:44 -i input.mp4 -t 00:02:00 -c:v libx264 -preset slow -crf 23 output.mp4

The above command does the same as the first one except it will compress the file, it takes longer but the end file will be smaller.

To read up on FFmpeg and encoding settings read here.