Files
linux-wiki/content/deepin折腾笔记/第六章/6.11.7.md
2021-10-21 14:57:58 +08:00

8 lines
749 B
Markdown
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 6.11.7 ffmpeg 截取视频
ffmpeg -i in.mp4 -to 5 -c copy out.mp4 #截取开头至第5秒
ffmpeg -i in.mp4 -ss 10 -c copy out.mp4 #截取第10秒至结束
ffmpeg -i in.mp4 -ss 6 -to 9 -c copy out.mp4 #截取第6秒至第9秒
ffmpeg -i in.mp4 -ss 8 -t 5 -c copy out.mp4 #从第8秒开始截取5秒
ffmpeg为了加速会使用关键帧技术所以有时剪切出来的结果在起止时间上未必准确。通常来说把-ss选项放在-i之前会使用关键帧技术把-ss选项放在-i之后则不使用关键帧技术。如果要使用关键帧技术又要保留时间戳可以加上-copyts选项
ffmpeg -ss 00:01:00 -i in.mp4 -to 00:02:00 -c copy -copyts cut.mp4