从具有FFMPEG的视频中提取音频,但持续时间不同 [英] Extract audio from video with FFMPEG but not the same duration

查看:457
本文介绍了从具有FFMPEG的视频中提取音频,但持续时间不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是我需要用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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆