从具有FFMPEG的视频中提取音频,但持续时间不同 [英] Extract audio from video with FFMPEG but not the same duration
问题描述
我的问题是我需要用FFMPEG提取视频中包含的音频,并且持续时间相同.但是对于我测试过的某些文件,音频的持续时间有时比视频的持续时间短.我需要音频和视频文件之间的时长完全相同.
My problem is that i need to extract with FFMPEG the audio contained in a video with the same duration. But for some files that i tested, the audio's duration is sometimes shorter than the video's duration. I need to have the exact same duration between the audio and the video file.
我已经尝试过的命令如下:
The command that i have already tried is this following:
ffmpeg -i input_video.mp4 output_audio.wav
ffmpeg -i input_video.mp4 output_audio.wav
如何使用命令中的选项解决此问题?
How can i fix this with options in my command ?
推荐答案
我找到了解决方案.要获得长度完全相同的音频摘录.我这样使用选项 -async 1
:
I found the solution. To get an audio extract with the exact same length. I use the option -async 1
like this:
ffmpeg -i input_video.mp4 -async 1 output_audio.wav
这篇关于从具有FFMPEG的视频中提取音频,但持续时间不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!