Decode audio stream channels to multiple wavs using ffmpeg?

心已入冬 提交于 2019-12-12 03:16:24

问题


My goal is to decode an ac3 from avi to multiple wavs - one for each channel, using ffmpeg.

Using

ffmpeg.exe -i the.avi -c:a copy the.ac3 the.wav

would decode it to a single wav, and typing the.wavs won't help...
I know it can be done with other tools, but I want to know how it's achievable with ffmpeg.


回答1:


From the docs:

You can also extract each channel of an input to specific outputs; the following command extracts two channels of the INPUT audio stream (file 0, stream 0) to the respective OUTPUT_CH0 and OUTPUT_CH1 outputs:

ffmpeg -i INPUT -map_channel 0.0.0 OUTPUT_CH0 -map_channel 0.0.1 OUTPUT_CH1

In your case it'll look something like:

ffmpeg.exe -i teh.avi -c:a copy -map_channel 0.0.0 0.wav -map_channel 0.0.1 1.wav

Assuming that the ac3 is stream 0 in the avi.



来源:https://stackoverflow.com/questions/9725273/decode-audio-stream-channels-to-multiple-wavs-using-ffmpeg

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!