1

I have a single WAV file containing 8 channels (it is NOT 7.1, all channels are full bandwidth) and I need to split it to 4 stereo WAV files. Of course it is easy to split it into 8 mono files, and then pack them in pairs to 4 stereo files. But I am searching for a single command doing this in one step, as I am not allowed to use 5 different commands ...

2
  • Welcome to SuperUser. I would suggest you need to define why you can't use 5 different commands, as it will provide additional context to your goal.
    – Stese
    Aug 16, 2017 at 15:01
  • I don't know. I was just asked to provide a single-line command doing this task... Aug 16, 2017 at 15:22

3 Answers 3

1

Well, I found the answer. The correct command is this one:

C:\Temp>ffmpeg -i test.wav -map_channel 0.0.0 -map_channel 0.0.1 first.wav -map_channel 0.0.2 -map_channel 0.0.3 second.wav -map_channel 0.0.4 -map_channel 0.0.5 third.wav -map_channel 0.0.6 -map_channel 0.0.7 fourth.wav
1
0

Try something along the lines of

ffmpeg -i whatever.wav -map 0:0 -map 0:1 -vn -c copy first.wav -map 0:2 -map 0:3 -vn -c copy second.wav -map 0:4 -map 0:5 -vn -c copy third.wav -map 0:6 -map 0:7 -vn -c copy fourth.wav
2
  • Thanks... But it does not work, it says: Stream map '0:1' matches no streams. To ignore this, add a trailing '?' to the map. Aug 16, 2017 at 15:05
  • For being more precise, the command was: C:\Temp\ffmpeg -i test.wav -map 0:0 -map 0:1 -vn -c copy first.wav -map 0:2 -map 0:3 -vn -c copy second.wav -map 0:4 -map 0:5 -vn -c copy third.wav -map 0:6 -map 0:7 -vn -c copy fourth.wav Aug 16, 2017 at 15:13
0

Assuming this is a 8 channel single-stream WAV, use

ffmpeg -i in.wav -filter_complex
          "[0]pan=stereo|c0=c0|c1=c1[a];
           [0]pan=stereo|c0=c2|c1=c3[b];
           [0]pan=stereo|c0=c4|c1=c5[c];
           [0]pan=stereo|c0=c6|c1=c7[d]"
       -map "[a]" first.wav
       -map "[b]" second.wav
       -map "[c]" third.wav
       -map "[d]" fourth.wav
2
  • Sorry, this is too long, I need a single-line command, as the one I did find and is shown above... If I was allowed to use more lines, then I had followed the simple way, to first create 8 mono files, and then to pack them two by two... Aug 16, 2017 at 15:19
  • 1
    It is a single line command. I have formatted it for readability.
    – Gyan
    Aug 16, 2017 at 15:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .