Sometimes you want to trim videos at the command line, my workflow goes like this, figure out where I want the vid to start and end, and then run the following command:
ffmpeg -i input.mp4 -ss 00:01:00 -to 00:01:30 -c copy output.mp4
- -i input.mp4: Specifies the input file.
- -ss 00:01:00: Sets the start time to 1 minute into the video.
- -to 00:01:30: Sets the end time to 1 minute and 30 seconds.
- -c copy: Copies the codec, avoiding re-encoding and making the process faster.
- output.mp4: Specifies the output file name.
This will trim the video from 1:00 to 1:30, resulting in a 30-second clip.
Also note that you can leave off leading zeros in the time format so you could get 13 to 57 seconds with ffmpeg -i input.mp4 -ss 13 -to 57 -c copy output.mp4
.