欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 房产 > 家装 > Cut video with ffmpeg

Cut video with ffmpeg

2025/5/13 21:54:12 来源:https://blog.csdn.net/fareast_mzh/article/details/147783477  浏览:    关键词:Cut video with ffmpeg

To cut a snippet from a video based on timestamps like 02:52 to 04:20, the best tool is FFmpeg, which is fast, free, and doesn’t re-encode the video (so it keeps original quality if you don’t want re-encoding).

Here’s the command you can run in a terminal or command prompt:

ffmpeg -i "Narcos.1x06.Explosivos.(Spanish.English.Subs).BDRip.1080p.x265-EAC3.by.Legan.mkv" -ss 00:02:52 -to 00:04:20 -c copy output_snippet.mkv

Explanation:

  • -i specifies the input file.
  • -ss 00:02:52 is the start time (hh:mm:ss).
  • -to 00:04:20 is the end time.
  • -c copy tells FFmpeg to copy the streams without re-encoding.
  • output_snippet.mkv is the name of your output file.

Optional Note:

If -ss before -i gives more accurate cuts but slower, and placing it after -i (as above) is fast but might not be frame-exact depending on the codec. You can try both if accuracy is important.

For a social-media-friendly .mp4 output, and especially if you’re okay with a slightly slower but cleaner cut, you should re-encode the snippet to ensure full compatibility and accuracy.

Here’s the recommended FFmpeg command:

ffmpeg -i "Narcos.1x06.Explosivos.(Spanish.English.Subs).BDRip.1080p.x265-EAC3.by.Legan.mkv" -ss 00:02:52 -to 00:04:20 -c:v libx264 -c:a aac -movflags +faststart output_snippet.mp4

Explanation of new parts:

  • -c:v libx264: re-encode video using H.264 (widely supported).
  • -c:a aac: re-encode audio using AAC (social media-friendly).
  • -movflags +faststart: optimizes MP4 for streaming and social media.
  • output_snippet.mp4: your final output file in .mp4 format.

This will cut and convert the snippet cleanly for platforms like Instagram, Twitter, TikTok, etc.

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词