问题
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