ffmpeg extract channels without conversion

I'm using the following ffmpeg command to convert a multitrack wav to multiple mono tracks:

ffmpeg -i input.wav \ -map_channel 0.0.0 a.wav \ -map_channel 0.0.1 b.wav \ -map_channel 0.0.2 c.wav \ -map_channel 0.0.3 d.wav \

This works fine but it converts the channels to 16bit PCM:

...
Stream #0:0 -> #0:0 (pcm_s24le (native) -> pcm_s16le (native))
Stream #0:0 -> #1:0 (pcm_s24le (native) -> pcm_s16le (native))
Stream #0:0 -> #2:0 (pcm_s24le (native) -> pcm_s16le (native))
Stream #0:0 -> #3:0 (pcm_s24le (native) -> pcm_s16le (native))
...

I've also tried "-sample_fmt pcm_s24le" or "-sample_fmt s32" but both parameters were not recognized.

How can I extract the channels of a multiwav file without changing the bit depth?

1 Answer

The encoder pcm_s16le is being used for your .wav output. This encoder only supports the s16 sample format (see ffmpeg -h encoder=pcm_s16le and ffmpeg -sample_fmts).

You can choose the encoder pcm_s24le:

ffmpeg -i input.wav \ -map_channel 0.0.0 -c:a pcm_s24le a.wav \ -map_channel 0.0.1 -c:a pcm_s24le b.wav \ -map_channel 0.0.2 -c:a pcm_s24le c.wav \ -map_channel 0.0.3 -c:a pcm_s24le d.wav
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like