当前位置: 首页 > 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.

http://www.xdnf.cn/news/343999.html

相关文章:

  • 创建型模式:工厂方法(Factory Method)模式
  • 最新CDGP单选题(第四章)补充
  • 力扣智慧思想小题,目录力扣.跳跃游戏(思想很重要)力扣.跳跃游戏II(还是思想)力扣.分发糖果力扣151.反转字符串中的单词力扣.轮转数组
  • cat、more和less的区别
  • 趣味编程:答案之书
  • CSS动画
  • AI视频生成的艺术:镜头语言
  • 多模态大语言模型arxiv论文略读(六十四)
  • 算法每日一题 | 入门-分支结构-Apples Prologue/苹果和虫子
  • DevExtreme JS ASP.NET Core v25.1新功能预览 - 全新的Stepper组件
  • 《函数基本语法》
  • 标准 PVT (Process-Voltage-Temperature) 签核矩阵
  • VBA -- 学习Day2
  • Linux常用命令34——uname显示系统内核信息
  • P2415 集合求和 详解
  • idea出现tomcat不能正确部署的问题--解决方案2
  • 前端面试每日三题 - Day 28
  • OpenCV CPU性能优化
  • 【文档智能】开源的阅读顺序(Layoutreader)模型使用指南
  • 可变参数包 和 lambda表达式
  • 代码简洁之道
  • 公链钱包开发:技术逻辑与产品设计实践
  • 21、魔法传送阵——React 19 文件上传优化
  • 【Dv3Admin】Git 子模块在 Dv3admin 插件项目统一管理实践
  • SpringBoot的自动配置功能-笔记
  • 智能边缘计算系统:基于Python的创新应用
  • python3连接数据库工具类之Oracle
  • Day19 常见的特征筛选算法
  • 零拷贝的简单复习
  • Python变量作用域