FFMPEG: get last 10 seconds [closed]
Solution 1:
Use the -sseof
input option. From the documentation:
-sseof
position (input)
Like the-ss
option but relative to the "end of file". That is negative values are earlier in the file, 0 is at EOF.
Example:
ffmpeg -sseof -10 -i input.mp4 output.mp4
Note that in stream copy mode (by using the -c copy
output option or equivalent) the cut will occur on the nearest keyframe, so it may cut on your exact desired time. If more accuracy is needed you will have to re-encode instead of stream copy.