当前位置: 首页 > news >正文

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.

相关文章:

  • 前端如何处理精度丢失问题
  • Python开发系统
  • 比较Facebook与其他社交平台的隐私保护策略
  • http重新为https
  • 电梯称重控制仪功能与绳头板安装(客梯、货梯)关联性分析
  • springBoot2集成mybatis (手敲学习版)java入门友好
  • PostgreSQL 的 pg_start_backup 函数
  • 涨薪技术|0到1学会性能测试第53课-Tomcat配置
  • 【C语言干货】一维数组传参本质
  • 存储器:DDR和HBM的区别
  • AI视频生成的艺术:镜头语言
  • 【战略合作】开封大学_阀门产业学院+智橙PLM
  • 深入理解 Electron 的 IPC 通信机制:主渲染进程消息传递实战
  • 【论文+VLA】2505.GraspVLA——基于十亿级合成动作数据预训练的抓取基础模型(即将开源)
  • 【软件设计师:软件工程】9.软件开发模型与方法
  • python小记(十四):Python 中 **参数解包:深入理解与应用实践
  • WTK6900C-48L:离线语音芯片重构玩具DNA,从“按键操控”到“声控陪伴”的交互跃迁
  • WPF 子界面修改后通知到主页面
  • 一站式远程访问工具对比分析及选择建议
  • LeetCode:翻转二叉树
  • 马上评丨规范隐藏式车门把手,重申安全高于酷炫
  • 优秀“博主”在上海杨浦购房最高补贴200万元,有何条件?
  • 全国人大常委会启动食品安全法执法检查
  • “爱鸟周”为何不能像FI和花展那样“市区联动”
  • 眉山“笑气”迷局:草莓熊瓶背后的隐秘与危机
  • 外卖员投资失败负疚离家流浪,经民警劝回后泣不成声给父母下跪