FFMPEG: get the last 10 seconds

I try to get the last 10 seconds of a video of which I do not know the length, and then save these 10 seconds as a new video. Is this capable of using the ffmpeg command line? And if so, how?

thanks for the help

greets

+6
source share
1 answer

Use the -sseof . From the doc:

-sseof position (input / output)
Like the -ss , but relative to the "end of file". These are negative values โ€‹โ€‹previously in the file, 0 in EOF.

Example:

 ffmpeg -sseof -10 -i input.mp4 output.mp4 

Please note that in stream copy mode (using -c copy or equivalent), the cut will be performed on the nearest keyframe, so it can be cut to your exact time. If more accuracy is required, you will have to transcode rather than copy the stream.

+10
source

All Articles