将 AVI 文件与部分音轨合并
我需要合并两个 AVI 文件,其中音轨比视频音轨短得多 - 即它可能是几分钟的视频,最后没有声音。当我与 transcode
或 mencoder
合并时,声音和视频会“独立”合并在一起,因此我会生成一个 AVI 文件,其中所有音频都粘合在一起,并且所有的沉默也被粘在一起并放在最后,导致音频和视频之间严重失去同步。有没有办法合并这些文件,以便文件边界保持完整并将声音附加到正确的视频帧?我需要一个 Linux 命令行解决方案。
编辑:这是我正在使用的代码:
avimerge -i file.avi file2.avi -o result.avi
mencoder -oac copy -ovc copy -o result.avi file1.avi file2.avi
I need to merge two AVI files where sound tracks are substantially shorter than video ones - i.e. it can be minutes of video without sound at the end. When I merge either with transcode
or mencoder
, the sound and video are merged together "independently", so I am resulting in an AVI file where all the audio is glued together and all the silence is also glued together and put at the end causing enormous loss of sync between audio and video. Is there any way to merge those files so that the file boundaries are left intact and sound is attached to the proper video frames? I need a Linux command-line solution.
EDIT: Here is the code I am using:
avimerge -i file.avi file2.avi -o result.avi
mencoder -oac copy -ovc copy -o result.avi file1.avi file2.avi
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Ubuntu 存储库中有一个名为 avidemux 的工具,它似乎应该可以满足您的需要。
There is a tool in the Ubuntu repository called avidemux which seems like it should do what you need.