Saturday, 13 June 2020

Cutting the videos based on start and end time using ffmpeg

# -ss start point, -to end point
ffmpeg -i input.mp4
-ss 00:01:00 -to 00:02:00 -c copy output.mp4

# -t trim how many seconds from ss
ffmpeg -i input.mp4 -ss 00:01:00 -t 5 -c copy output.mp4

This command trims your video in seconds!
I have explained it on my blog here:
-i: This specifies the input file. In that case, it is (input.mp4). -ss: Used with -i, this seeks in the input file (input.mp4) to position. 00:01:00: This is the time your trimmed video will start with. -to: This specifies duration from start (00:01:40) to end (00:02:12).
00:02:00: This is the time your trimmed video will end with.
-c copy: This is an option to trim via stream copy. (NB: Very fast)
The timing format is: hh:mm:ss

p/s: https://stackoverflow.com/questions/18444194/cutting-the-videos-based-on-start-and-end-time-using-ffmpeg

No comments:

Post a Comment