如何通过给出开始和结束时间来使用ffmpeg更快地剪切视频!? [英] How to cut the video faster using ffmpeg by giving the start and end time!?

查看:496
本文介绍了如何通过给出开始和结束时间来使用ffmpeg更快地剪切视频!?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图通过使用ffmpeg命令行工具给出视频的开始和结束时间来准确地剪切视频。我有命令的样本,它会在几秒钟内剪切视频。这是代码: [E:\> ffmpeg -iinput.mp4-ss 00:00:03 -t 00:00:15 -acodec copy -vcodec copyoutput.mp4] 但问题是视频没有正确剪切起始时间。或者我有另一个示例代码 [E:\> ffmpeg -iinput.mp4-ss 00:00:03 -t 00:00:15 -acodec libx264 -vcodec ac3output.mp4] 在此代码中视频剪切正确的时间,但其花更多时间剪辑视频。我正在寻找能够准确,快速地切割视频的确切命令,如果有人帮我解决这个问题,我会更高兴。



谢谢&问候,

J.Surjith Kumar

I am trying to cut the video accurately by giving the start and end time of the video using ffmpeg command line tool. I have the sample of the command which will cut the video in fraction of seconds. Here is the code: [E:\> ffmpeg -i "input.mp4" -ss 00:00:03 -t 00:00:15 -acodec copy -vcodec copy "output.mp4"] but the problem is the video was not cut at the correct starting time. Alternatively i have another sample code [E:\> ffmpeg -i "input.mp4" -ss 00:00:03 -t 00:00:15 -acodec libx264 -vcodec ac3 "output.mp4"] in this code the video cutting at the correct time but its taking more time to cut the video. I am searching for the exact command which will cut the video accurately and faster, i will be more happy if anyone help me to get solution for this.

Thanks & regards,
J.Surjith Kumar

推荐答案

你的第一个命令只是音频和视频编解码器的直接副本,所以ffmpeg没做任何转码,如果是这种情况,也许它更依赖于流中的时间戳。您的剪切精度可能取决于源文件中时间戳的频率。如果时间戳是每2秒,那么这就是你的准确性。你的第二个命令可能导致转码发生,在这种情况下,ffmpeg可能对定时标记有更多的控制,事实上,可能是设置它自己的默认值。解决方案可能是增加源视频中的时间戳频率。如果源中的时间戳设置为300,而您的时间间隔为30帧/秒,则精度为10秒。
Your first command is just a straight copy of the audio and video codecs so ffmpeg is no doing any transcoding, and if that is the case, maybe it is more dependent on the timestamps that are in the stream. Your "cutting" accuracy may depend on the frequency of the timestamps in the source file. If the timestamps are every 2 seconds, then that is your accuracy. Your second command may be causing transcoding to happen, and in this case ffmpeg may has more control over timing marks, and in fact, may be setting it's own default. The solution may be to increase your timestamp frequency in your source video. If your timestamp setting in the source is say 300, and you are at 30 frames/second, your accuracy will be 10 seconds.


这篇关于如何通过给出开始和结束时间来使用ffmpeg更快地剪切视频!?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆