FFMPEG命令视频和音频的输出视频文件不匹配

发布于 2025-02-13 11:49:06 字数 316 浏览 2 评论 0原文

我正在尝试使用此命令使用FFMPEG修剪视频文件 ffmpeg -i input.mp4 -ss 00:05:20 -t 00:10:00 -c:v复制-c:复制output.mp4。问题是当我打开输出视频时,音频正常启动,但视频仅出现仅5秒钟。我尝试删除-c复制选项,并且输出是准确的,但是该过程非常慢。因此,我的问题是在使用-c复制选项时如何进行输出视频/音频匹配,或者在不使用-C复制选项时如何更快地使过程更快。这是我第一次使用它,所以我对视频/音频编码不了解,我只是想从PHP脚本中提取视频剪辑。

i'm trying to trim a video file using ffmpeg using this command
ffmpeg -i input.mp4 -ss 00:05:20 -t 00:10:00 -c:v copy -c:a copy output.mp4 . The problem is when i open the output video, the audio starts normally but the video appears only 5 seconds after. I tried removing the -c copy option and output is accurate but the process is very slow. So my question is how to make output video/audio match when using -c copy option, or how to make the process faster when not using -c copy option. It's my first time using this so i don't know much about video/audio encoding, i am just trying to extract a video clip from a php script.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

紫罗兰の梦幻 2025-02-20 11:49:06

通常,当音频在视频之前,-Async Switch自动校正在以-Async 1传递时,音频流的开始。所以尝试跑步

ffmpeg -async 1 -i input.mp4 -ss 00:05:20 -t 00:10:00 -c:v copy -c:a copy output.mp4

Usually when audio is ahead of video the -async switch auto-corrects the start of the audio stream when passed as -async 1. So try running

ffmpeg -async 1 -i input.mp4 -ss 00:05:20 -t 00:10:00 -c:v copy -c:a copy output.mp4
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文