Windows 用 ffmpeg 按时间戳裁剪视频片段

按起止时间从视频中截取片段,使用流复制模式完全不损画质。

Windows视频命令行FFmpeg低风险
把 -ss 和 -to 放在 -i 之前,再加 -c copy 即可免转码快速裁剪。

01命令

命令
$ ffmpeg -ss 00:01:30 -to 00:03:00 -i input.mp4 -c copy output.mp4

02作用说明

配合 -c copy 时 ffmpeg 只重新封装选中的数据包,一秒完成且无质量损失;但起点会对齐到最近的关键帧,长 GOP 视频可能偏差数秒。把 -ss 移到 -i 之后,或去掉 -c copy 改用 libx264 重新编码,即可获得逐帧精确的剪切,代价是处理时间变长。

03风险

风险低风险
使用条件ffmpeg must be installed (winget install Gyan.FFmpeg)
!注意: 流复制模式的剪切点会对齐关键帧,片段实际开头可能比请求时间稍早。

04撤销

✓无需撤销——该命令不会改变持久状态。

05来源

  • FFmpeg Wiki: Seeking
    FFmpeg · technical · 2026-09-17
    依据: Explains -ss/-to placement: putting -ss before -i seeks by keyframe and with -c copy produces a fast stream copy with minimal accuracy loss.
  • FFmpeg Documentation
    FFmpeg · vendor-doc · 2026-09-17
    依据: Documents the -ss, -to and -c copy options used for timestamp-based stream copying.

最后验证: 2026-09-17 · 分类: 媒体