如何使用ffmpeg从视频中提取音频? [英] How can I extract audio from video with ffmpeg?
本文介绍了如何使用ffmpeg从视频中提取音频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试了以下命令从视频中提取音频:
I tried the following command to extract audio from video:
ffmpeg -i Sample.avi -vn -ar 44100 -ac 2 -ab 192k -f mp3 Sample.mp3
但是我得到以下输出
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.19. 0 / 1.19. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0
SamplE.avi: Invalid data found when processing input
任何人都可以帮忙吗?
推荐答案
要提取音频流而无需重新编码:
To extract the audio stream without re-encoding:
ffmpeg -i input-video.avi -vn -acodec copy output-audio.aac
-
-vn
没有视频. -
-acodec copy
说使用那里已经存在的相同音频流. -vn
is no video.-acodec copy
says use the same audio stream that's already in there.
读取输出以查看它是什么编解码器,以设置正确的文件扩展名.
Read the output to see what codec it is, to set the right filename extension.
这篇关于如何使用ffmpeg从视频中提取音频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文