FFMPEG: get last 10 seconds [closed]

2019-01-25 14:29发布

I'm trying to get the 10 last seconds of a video of which I dont know the length and then save those 10 seconds as a new video. Is this do able with the ffmpeg command prompt? And if so, how?

Thanks for the help

Greets

标签: ffmpeg
1条回答
男人必须洒脱
2楼-- · 2019-01-25 15:03

Use the -sseof option. From the documentation:

-sseof position (input/output)
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 -c copy 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.

查看更多
登录 后发表回答