简体   繁体   English

从具有FFMPEG的视频中提取音频,但持续时间不同

[英]Extract audio from video with FFMPEG but not the same duration

My problem is that i need to extract with FFMPEG the audio contained in a video with the same duration. 我的问题是我需要使用FFMPEG提取视频中包含的音频,且音频持续时间相同。 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 ? 如何使用命令中的选项解决此问题?

I found the solution. 我找到了解决方案。 To get an audio extract with the exact same length. 要获得长度完全相同的音频摘录。 I use the option -async 1 like this: 我这样使用-async 1选项:

ffmpeg -i input_video.mp4 -async 1 output_audio.wav

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM