当前位置: 首页 > 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.dtcms.com/a/179275.html

相关文章:

  • 前端如何处理精度丢失问题
  • 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:翻转二叉树
  • 使用OpenFOAM中的VOF模型仿真两相流
  • maven如何搭建自己的私服(windows版)?
  • Java 的 Monitor 机制:原理与源码详解
  • [git]如何关联本地分支和远程分支
  • 数据库的进阶操作
  • 路由器断流排查终极指南:从Ping测试到Wireshark抓包5步定位法
  • 基于GlusterFS的分布式存储集群部署实战指
  • System-V 共享内存
  • JavaScript中数组和对象不同遍历方法的顺序规则
  • 驱动开发硬核特训 · Day 30(上篇):深入理解 I2C 总线驱动模型(以 at24 EEPROM 为例)