[英]Extract the English audio of video file using ffmpeg
I like to extract the English audio stream of a video file using ffmpeg. 我喜欢使用ffmpeg提取视频文件的英语音频流。 Also, if the file doesn't have an English audio stream, I want to extract all audio streams.
另外,如果文件没有英语音频流,我想提取所有音频流。 Preferably with a language suffix in their names, if their languages is known.
如果已知其语言,则最好在其名称中带有语言后缀。
First, you need to submit your file to get informations regarding streams : 首先,您需要提交文件以获取有关流的信息:
ffmpeg -i your_file.mp4
Then you will get all streams corresponding to your file. 然后,您将获得与文件相对应的所有流。 For example : Stream #0:4(eng) for an english subtitle
例如:英文字幕的流#0:4(eng)
Then you can extract audio doing : 然后您可以提取音频:
ffmpeg -i input.mp4 -map 0:4 -c copy audio0.mp3
to extract audio as an mp3 file 将音频提取为mp3文件
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.