用 ffmpeg 无损剪切视频片段
不重新编码,几秒钟截取视频中的任意一段。
执行 ffmpeg -ss 00:01:30 -to 00:03:00 -i input.mp4 -c copy clip.mp4,即可无损截取 1:30 到 3:00 的片段。
01命令
命令
$ ffmpeg -ss 00:01:30 -to 00:03:00 -i input.mp4 -c copy clip.mp402作用说明
加 -c copy 时 ffmpeg 只是把现有的音视频数据原样搬进新文件,不做解码,所以剪切几乎瞬间完成且画质无损。-ss 是开始时间,-to 是结束时间(也可用 -t 指定时长);把 -ss 写在 -i 之前可以先快进定位,长视频上快得多。若要求帧级精确或编码特殊,去掉 -c copy 让 ffmpeg 重新编码即可。
03风险
!注意: 流复制只能从关键帧开始,片段开头可能早几帧或闪一下——需要精确时请重新编码(加 -c:v libx264 -c:a aac)。MP4 输出可以加 -movflags +faststart,方便浏览器和编辑器播放。
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- ffmpeg(1) — Arch Manual Pages依据: Same options: input/output seeking with -ss/-to and stream copy via -c copy described in detail.
- ffmpeg(1) — Debian bookworm依据: Documents -ss position, -to position, -t duration and the -c copy stream-copy mode for cutting without re-encoding.
最后验证: 2026-09-19 · 分类: 媒体