ffmpeg 声音与 -concat 或 -ss 不同步
我有一个工具,可以从 3D 应用程序中输出视频,然后将各个视频连接起来形成一个序列。但声音似乎在序列中不同步(单个文件很好),并且在 VLC 和 Quicktime 中出现断断续续的情况。令我惊讶的是,Windows 媒体播放器似乎可以处理它,但它仍然不同步。我有两种情况,一种有效,一种无效,但我需要两者都工作:
工作:
已经创建了 movs...
转换为 avi:os.system( ffmpeg + " -i C:\clip.mov -sameq -r 24 -y C:\clip.avi")
连接到 avi 序列:
os.system( ffmpeg + ''' -i concat: C:\clip.avi|C:\clip1.avi|C:\clip2.avi -sameq -r 24 -y C:\sequence.avi' '' )
将序列转换为 mov:os.system( ffmpeg + " -i C:\sequence.avi -sameq -r 24 -y C:\sequence.mov")
不工作: 从 3D 程序创建单独的 avi...
剪切到正确的长度:os.system(ffmpeg + " -i C:\clip.avi -sameq -r 24 -ss " + startTime + " -vframes " + totalFrames + " -y C:\clip.avi" )
连接到 avi 序列:
os.system( ffmpeg + ''' -i concat: C:\clip.avi|C:\clip1.avi|C:\clip2.avi -sameq -r 24 -y C:\sequence.avi' '' )
将序列转换为 mov: os.system( ffmpeg + " -i C:\sequence.avi -sameq -r 24 -y C:\sequence.mov")
将单个 avi 转换为 mov: os.system( ffmpeg + " -i C:\clip.avi-sameq -r 24 -y C:\clip.mov")
请让我知道哪里出了问题?
I have a tool that spits out video from a 3D application and then concats the individual videos to make a sequence. But the sound seems to go out of sync in the sequence (the inividual files are fine) and it stutters in VLC and Quicktime. Windows media player seems to handle it bes to my supprise, yet it still goes out of sync. I have two senarios, one works and one doesn't but i need both working:
Working:
get already created out movs...
convert to avi:os.system( ffmpeg + " -i C:\clip.mov -sameq -r 24 -y C:\clip.avi")
concat to avi sequence:os.system( ffmpeg + ''' -i concat: C:\clip.avi|C:\clip1.avi|C:\clip2.avi -sameq -r 24 -y C:\sequence.avi''' )
convert sequence to mov:os.system( ffmpeg + " -i C:\sequence.avi -sameq -r 24 -y C:\sequence.mov")
Not Working:
create individual avi's from 3D program...
cut down to correct length:os.system(ffmpeg + " -i C:\clip.avi -sameq -r 24 -ss " + startTime + " -vframes " + totalFrames + " -y C:\clip.avi" )
concat to avi sequence:os.system( ffmpeg + ''' -i concat: C:\clip.avi|C:\clip1.avi|C:\clip2.avi -sameq -r 24 -y C:\sequence.avi''' )
convert sequence to mov:os.system( ffmpeg + " -i C:\sequence.avi -sameq -r 24 -y C:\sequence.mov")
convert individual avi's to mov:os.system( ffmpeg + " -i C:\clip.avi-sameq -r 24 -y C:\clip.mov")
Please let me know where I've gone wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,这是切割过程中的“-sameq”标志。它弄乱了音频,所以我只是更改
为
- 强制 ffmpeg 使用 pcm_s16le 作为音频编解码器,而不是 -sameq 使用的不同步的编解码器......并且修复了它!
希望这可以帮助别人。
Turns ou it was the "-sameq" flag during the cutting process. It was messing up the audio so I just changed
to
- forcing ffmpeg to use pcm_s16le as the audio codec instead of the out of sync one the -sameq was using...and that fixed it!
Hope this can help someone else.