Knowledge Base

Use ffmpeg to trim video

To cut a video, without re-encoding

Use this to cut video from [start] for [duration]:

ffmpeg -ss [start] -i in.mp4 -t [duration] -c copy out.mp4

Here, the options mean the following:

Note that if you've used -ss, you have to subtract this from the -to timestamp. For example, if you cut with -ss 3 -i in.mp4 -to 5, the output will be five seconds long.

For more info, see https://trac.ffmpeg.org/wiki/Seeking

Example

To keep the first 26 minutes of a 41 minute video:

ffmpeg -ss 00:00:00 -i file~00.mkv -t 00:26:00 -c copy file.mkv