I have this file, and would be cool use ffmpeg for extract all audio channels to separate files..
I know how to extract a single channel at time in a way like:
ffmpeg -i input.mov -map 0:1 -c:a copy output.mov
However this will work for the first channel only.
Aside with for $i 0 to 15, is there a way to extract all the audio channels at one in a specific directory?
ffprobe says:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\myfile.mov':
Metadata:
creation_time : 2016-04-25T14:10:57.000000Z
timecode : 10:00:00:00
Duration: 01:30:36.32, start: 0.000000, bitrate: 193036 kb/s
Stream #0:0(eng): Video: prores (apch / 0x68637061), yuv422p10le(bt709, progressive), 1920x1080, 174295 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 25 tbn, 25 t
bc (default)
Metadata:
creation_time : 2016-04-25T14:10:57.000000Z
handler_name : Apple Alias Data Handler
encoder : Apple ProRes 422 (HQ)
Stream #0:1(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
Metadata:
creation_time : 2016-04-25T14:10:57.000000Z
handler_name : Apple Alias Data Handler
reel_name : Unnamed
timecode : 10:00:00:00
Stream #0:2(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 16 channels, s32 (24 bit), 18432 kb/s (default)
Metadata:
creation_time : 2016-04-25T14:10:57.000000Z
handler_name : Apple Alias Data Handler
Unsupported codec with id 0 for input stream 1
EDIT: It should be something like this..
ffmpeg -i input.mov -filter_complex \
"[0:a]pan=mono|c0=c0[a0]; \
[0:a]pan=mono|c0=c1[a1]; \
[0:a]pan=mono|c0=c2[a2]; \
[0:a]pan=mono|c0=c3[a3]; \
[0:a]pan=mono|c0=c4[a4]; \
[0:a]pan=mono|c0=c5[a5]; \
[0:a]pan=mono|c0=c6[a6]; \
[0:a]pan=mono|c0=c7[a7]; \
[0:a]pan=mono|c0=c8[a8]; \
[0:a]pan=mono|c0=c9[a9]; \
[0:a]pan=mono|c0=c10[a10]; \
[0:a]pan=mono|c0=c11[a11]" \
[0:a]pan=mono|c0=c12[a12]" \
[0:a]pan=mono|c0=c13[a13]" \
[0:a]pan=mono|c0=c14[a14]" \
[0:a]pan=mono|c0=c15[a15]" \
-c copy -c:a pcm_s24le
-map 0 -map -0:a -map "[a0]" audio_00.wav -map "[a1]" audio_01.wav -map "[a2]" audio_02.wav -map "[a3]" audio_03.wav \
-map "[a4]" audio_04.wav -map "[a5]" audio_05.wav -map "[a6]" audio_06.wav -map "[a7]" audio_07.wav \
-map "[a8]" audio_08.wav -map "[a9]" audio_09.wav -map "[a10]" audio_10.wav -map "[a11]" audio_11.wav
-map "[a12]" audio_12.wav -map "[a13]" audio_13.wav -map "[a14]" audio_14.wav -map "[a15]" audio_15.wav
-map 0:1
which maps a stream, not a channel. There's-map_channel
which just callspan
. You still have to manually probe # of channels and compose the filtergraph.