I need to extract channels from 5.1 audios. These audio tracks are contained in a MKV file. Structure of "movie.mkv" file is like this:
Input #0, matroska,webm, from 'movie.mkv':
Duration: 00:40:38.08, start: 0.000000, bitrate: 21128 kb/s
Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x800 [SAR 1:1 DAR 12:5], 24 fps, 24 tbr, 1k tbn, 48 tbc
Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
Stream #0:2(ger): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s
Stream #0:3(eng): Subtitle: subrip
But the syntax is very messy, so I did not figure out how to extract channels properly.
This code, for the first audio track, works fine:
ffmpeg -i "movie.mkv" -map_channel 0.1.0 "eng channel 1.wav"
ffmpeg -i "movie.mkv" -map_channel 0.1.1 "eng channel 2.wav"
ffmpeg -i "movie.mkv" -map_channel 0.1.2 "eng channel 3.wav"
ffmpeg -i "movie.mkv" -map_channel 0.1.3 "eng channel 4.wav"
ffmpeg -i "movie.mkv" -map_channel 0.1.4 "eng channel 5.wav"
ffmpeg -i "movie.mkv" -map_channel 0.1.5 "eng channel 6.wav"
I believe that 0.1.0 is: input #0 (movie.mkv); then stream 1 (audio eng); then channel 0 (very first channel).
But when I'm trying to extract channels from second audio track...
ffmpeg -i "movie.mkv" -map_channel 0.2.0 "ger channel 1.wav"
ffmpeg -i "movie.mkv" -map_channel 0.2.1 "ger channel 2.wav"
ffmpeg -i "movie.mkv" -map_channel 0.2.2 "ger channel 3.wav"
ffmpeg -i "movie.mkv" -map_channel 0.2.3 "ger channel 4.wav"
ffmpeg -i "movie.mkv" -map_channel 0.2.4 "ger channel 5.wav"
ffmpeg -i "movie.mkv" -map_channel 0.2.5 "ger channel 6.wav"
...it extracts not German sound, but instead it results with the same eng channels (which also sound little louder than in previous case). In this code, 0.2.0 appears to be: input #0 (movie.mkv); then stream 2 (audio ger); then channel 0 (very first channel).
So what am I doing wrong? :-)