gpt4 book ai didi

video - 使用 ffmpeg 根据开始和结束时间剪切视频

转载 作者:IT老高 更新时间:2023-10-28 12:14:58 27 4
gpt4 key购买 nike

我尝试使用以下命令使用视频的开始和结束时间剪切视频

ffmpeg -ss 00:00:03 -t 00:00:08 -i movie.mp4 -acodec copy -vcodec copy -async 1 cut.mp4

通过使用上述命令,我想将视频从 00:00:03 剪切到 00:00:08。但它不是在这些时间之间剪切视频,而是在前 11 秒剪切视频。谁能帮我解决这个问题?

编辑 1:

我尝试使用 mark4o 建议的以下命令进行剪切

ffmpeg -i movie.mp4 -ss 00:00:03 -t 00:00:08 -async 1 cut.mp4

但显示如下错误。

编码器“aac”是实验性的,但实验性编解码器未启用

所以我将 -strict -2 添加到命令中,即,

ffmpeg -i movie.mp4 -ss 00:00:03 -t 00:00:08 -async 1 -strict -2 cut.mp4

现在一切正常。

最佳答案

尝试使用它。这是我发现的最快最好的 ffmpeg 方式:

ffmpeg -ss 00:01:00 -to 00:02:00 -i input.mp4 -c copy output.mp4

此命令可在几秒钟内修剪您的视频!

命令说明:

-i: This specifies the input file. In that case, it is (input.mp4).
-ss: Used with -i, this seeks in the input file (input.mp4) to position.
00:01:00: This is the time your trimmed video will start with.
-to: This specifies duration from start (00:01:40) to end (00:02:12).
00:02:00: This is the time your trimmed video will end with.
-c copy: This is an option to trim via stream copy. (NB: Very fast)

计时格式为:hh:mm:ss

请注意,当前高度赞成的答案已经过时,并且修剪会非常缓慢。更多信息,看这个官方的ffmpeg article .

关于video - 使用 ffmpeg 根据开始和结束时间剪切视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18444194/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com