Wednesday, November 01, 2017

Cutting Video with ffmpeg

The highlighted represent the starting point for the cut. In this case no ending point set, so by default the output will include all the remaining of the video.

ffmpeg -i input.mp4 -ss 00:20:01 -async 1 -c copy output.mp4 

If we want to cut the video before the end we cand do it in two ways:

ffmpeg -i input.mp4 -ss 00:20:03 -t 00:01:08 -async 1 -c copy output.mp4

The "-t" option specifies a duration, not an end time. The above command will encode 1 minute and 8 seconds of video starting from the time 00:20:01

ffmpeg -i input.mp4 -ss 00:20:03 -to 00:21:11 -async 1 -c copy output.mp4

If you are using a current version of ffmpeg you can also replace "-t" with "-to" in the above command to end at the specified time.

Note:
Use "-c copy" for making it instantly. In that case ffmpeg will not re-encode the video, just will cut to according size.


-----///