Activity › Forums › Compression Techniques › Splitting 14 channels into 14 tracks
-
Splitting 14 channels into 14 tracks
Posted by Dave Johnston on October 10, 2012 at 9:01 amHi all,
Is there any way, using ffmpeg, to split out a single ‘Sound Track’ with 14 ‘mono’ channels in it out to 14 seperate ‘tracks’, each with a single channel?
I’ve been reading through all the documentation and scratching my head, but I can’t seem to find a useful solution.
D
Kev James replied 12 years, 1 month ago 4 Members · 12 Replies -
12 Replies
-
Michael Rampe
October 10, 2012 at 10:56 pmCan you post a sample file?
I think the “channelsplit” filter in a -filter_complex chain should be able to achieve this….
Michael
-
Reuben Martin
October 11, 2012 at 5:29 amThe answer can vary depending on how the audio is muxed.
It could be 14 streams with a single channel each, it could be 1 stream with 14 channels, or it could be anything in-between with multiple streams having multiple channels.
-
Dave Johnston
October 11, 2012 at 8:24 amHi all,
Sorry, I should have been clearer.
The file in question is a Quicktime (ProRes 422 HQ) with one track Video, one track Sound and one track TC. It’s been exported from a professional colour grading system.
The Audio is 48khz, 6-bit linear pcm, 14 channels within the single sound track (identified as ‘mono’ channels within Quicktime.
I’m trying to split them out to 14 discete tracks.
I had a look at -filter_complex and -asplit but couldn’t find anything to do the job.
Any help is greatly appreciated!
D
-
Michael Rampe
October 11, 2012 at 9:28 amHi Dave,
OK. I have created a replica of your file – 1 prores video track (stream 0:0) and 14 mono audio streams (streams 0:1 though 0:14) and one timecode track (stream 0:15). (NOTE: my audio was 16 bit, not sure if 6 bit was a typo in your post but it will not matter anyway)
You can achieve what you are after with simple mapping.
$ ffmpeg -i 14ch.mov -map 0:1 1.wav -map 0:2 2.wav -map 0:3 3.wav -map 0:4 4.wav -map 0:5 5.wav -map 0:6 6.wav -map 0:7 7.wav -map 0:8 8.wav -map 0:9 9.wav -map 0:10 10.wav -map 0:11 11.wav -map 0:12 12.wav -map 0:13 13.wav -map 0:14 14.wav
This split all 14 discrete streams to 14 individual wav files.
Stream mapping:
Stream #0:1 -> #0:0 (pcm_s16le -> pcm_s16le)
Stream #0:2 -> #1:0 (pcm_s16le -> pcm_s16le)
Stream #0:3 -> #2:0 (pcm_s16le -> pcm_s16le)
Stream #0:4 -> #3:0 (pcm_s16le -> pcm_s16le)
Stream #0:5 -> #4:0 (pcm_s16le -> pcm_s16le)
Stream #0:6 -> #5:0 (pcm_s16le -> pcm_s16le)
Stream #0:7 -> #6:0 (pcm_s16le -> pcm_s16le)
Stream #0:8 -> #7:0 (pcm_s16le -> pcm_s16le)
Stream #0:9 -> #8:0 (pcm_s16le -> pcm_s16le)
Stream #0:10 -> #9:0 (pcm_s16le -> pcm_s16le)
Stream #0:11 -> #10:0 (pcm_s16le -> pcm_s16le)
Stream #0:12 -> #11:0 (pcm_s16le -> pcm_s16le)
Stream #0:13 -> #12:0 (pcm_s16le -> pcm_s16le)
Stream #0:14 -> #13:0 (pcm_s16le -> pcm_s16le)Let me know if this solves it….
Michael
-
Dave Johnston
October 11, 2012 at 9:44 amHi Michael,
That’s great, certainly one step closer.
Is there any way to, without exporting, take the individual streams/channels and route them into seperate audio tracks within ffmpeg?
So something like
In File > FFMPEG (taking 14 streams into 14 tracks) > out file
Thanks again!
D -
Dave Johnston
October 11, 2012 at 11:24 amFor reference, this is the stream layout :
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
‘file.mov’:
Metadata:
creation_time : 2012-10-09 15:11:39
Duration: 00:03:18.52, start: 0.000000, bitrate: 133624 kb/s
Stream #0:0(eng): Video: prores (apch / 0x68637061), yuv422p10le,
1920×1080, 122869 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc
Metadata:
creation_time : 2012-10-09 15:11:39
handler_name : ?Linux Alias Data Handler
Stream #0:1(eng): Audio: pcm_s16be (lpcm / 0x6D63706C), 48000 Hz, 14
channels, s16, 10752 kb/s
Metadata:
creation_time : 2012-10-09 15:11:39
handler_name : ?Linux Alias Data Handler
Stream #0:2(eng): Data: none (tmcd / 0x64636D74)
Metadata:
creation_time : 2012-10-09 15:11:53
handler_name : $Libquicktime Time Code Media Handler
timecode : 09:59:10:00 -
Reuben Martin
October 11, 2012 at 6:57 pmI think there’s some mis-communication in terminology. “Track” is a term more suited for video editing or a DAW.
The breakdown in this case goes: Container Format -> Stream -> Channel
What you want to do is convert from one audio stream with 14 channels to 14 audio streams with a single channel.
This should work. (Can’t test it right now though)
$ ffmpeg -i 14ch.mov -vcodec copy -acodec copy -filter_complex channelsplit -f mov 14str.mov
-
Dave Johnston
October 15, 2012 at 8:01 amThanks Reuben, the only reason I referred to them as ‘tracks’ as that is the Quicktime nomenclature.
The example you provided would work however FFMPEG has in built channel_layout definitions, none of which go upto 14 channels.
Still having no luck with this. Only solution thus far seems to be a mixture of splitting out a WAV with ffmpeg, mixing it out to 14 seperate WAVs with ‘sox’ then re-muxing it back in with FFMPEG.
-
Reuben Martin
October 16, 2012 at 6:00 amyuck. You’re right, I just looked it up. Can’t handle more than 8 channels. Try using map-channel.
ffmpeg -i input.mov -map 0:0 -map 0:1 -map 0:1 -map 0:1 -map 0:1 -map 0:1 -map 0:1 -map 0:1 -map 0:1 -map 0:1 -map 0:1 -map 0:1 -map 0:1 -map 0:1 -map 0:1 -map_channel 0.1.0:0.1 -map_channel 0.1.1:0.2 -map_channel 0.1.2:0.3 -map_channel 0.1.3:0.4 -map_channel 0.1.4:0.5 -map_channel 0.1.5:0.6 -map_channel 0.1.6:0.7 -map_channel 0.1.7:0.8 -map_channel 0.1.8:0.9 -map_channel 0.1.9:0.10 -map_channel 0.1.10:0.11 -map_channel 0.1.11:0.12 -map_channel 0.1.12:0.13 -map_channel 0.1.13:0.14 -vcodec copy -acodec pcm_s16be output.movVery long, and don’t have anything to test it with. But should be close to something like that.
-
Dave Johnston
October 16, 2012 at 8:22 amAppreciate all the help Reuben!
This seems to take the 14 channel stream and copy it to 14 streams with 14 channels in the output file. I’ve tried various permutations and additions to this but i’m not sure i’m not hitting a limitation of FFMPEG here.
I can only assume it’s possible in a one-liner as, if there were a channel_layout with 14 channels, then I could use that.
Very frustrating! 🙂
Reply to this Discussion! Login or Sign Up