cut video ffmpeg code example

Example 1: crop video from specific time to specific time ffmpeg

ffmpeg -ss 00:01:00 -i input.mp4 -to 00:02:00 -c copy output.mp4
# Triming in ffmpeg

Example 2: ffmpeg trim video

ffmpeg -ss 00:00:30.0 -i input.wmv -c copy -t 00:00:10.0 output.wmv
ffmpeg -ss 30 -i input.wmv -c copy -t 10 output.wmv

Example 3: cut part of video ffmpeg

#-ss option to specify a start timestamp, and the -t option to specify the encoding duration.
# The timestamps need to be in HH:MM:SS.xxx format or in seconds (s.msec).
ffmpeg -ss 00:00:30.0 -i input.wmv -c copy -t 00:00:10.0 output.wmv
ffmpeg -ss 30 -i input.wmv -c copy -t 10 output.wmv