To cut a video-file down to a section in the file, use the following command:
# Absolute times (see note below!)
ffmpeg -ss 00:02:05 -i <file> -map 0 -c copy -to 00:23:01 <out>.mkv
# Relative times
ffmpeg -ss 00:02:05 -i <file> -map 0 -c copy -t 00:21:54 <out>.mkv
NOTE: The -to
option doesn’t take the absolute time from the input file, because -ss
resets the timer to 0 at the absolute time given to -ss
.
- Either set
-to
relative to-ss
- or use
-t
and specify the length of the resulting output instead
Time must be specified in a supported format, usually either hh:mm:ss
or mm:ss
.
Mostly taken from this SuperUser Answer
Comments
No comment section here 😄
You can reach me over at @knuth_dev or send me an Email.