FORUMS: list search recent posts

Splitting 14 channels into 14 tracks

COW Forums : FFmpeg

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
dave johnston
Splitting 14 channels into 14 tracks
on Oct 10, 2012 at 9:01:49 am

Hi 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


Return to posts index

Michael Rampe
Re: Splitting 14 channels into 14 tracks
on Oct 10, 2012 at 10:56:08 pm

Can you post a sample file?

I think the "channelsplit" filter in a -filter_complex chain should be able to achieve this....

Michael


Return to posts index

Reuben Martin
Re: Splitting 14 channels into 14 tracks
on Oct 11, 2012 at 5:29:28 am

The 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.


Return to posts index


dave johnston
Re: Splitting 14 channels into 14 tracks
on Oct 11, 2012 at 8:24:29 am

Hi 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


Return to posts index

Michael Rampe
Re: Splitting 14 channels into 14 tracks
on Oct 11, 2012 at 9:28:56 am

Hi 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


Return to posts index

dave johnston
Re: Splitting 14 channels into 14 tracks
on Oct 11, 2012 at 9:44:44 am

Hi 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


Return to posts index


dave johnston
Re: Splitting 14 channels into 14 tracks
on Oct 11, 2012 at 11:24:26 am

For 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,
1920x1080, 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


Return to posts index

Reuben Martin
Re: Splitting 14 channels into 14 tracks
on Oct 11, 2012 at 6:57:12 pm

I 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


Return to posts index

dave johnston
Re: Splitting 14 channels into 14 tracks
on Oct 15, 2012 at 8:01:05 am

Thanks 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.


Return to posts index


Reuben Martin
Re: Splitting 14 channels into 14 tracks
on Oct 16, 2012 at 6:00:20 am

yuck. 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.mov

Very long, and don't have anything to test it with. But should be close to something like that.


Return to posts index

dave johnston
Re: Splitting 14 channels into 14 tracks
on Oct 16, 2012 at 8:22:49 am

Appreciate 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! :)


Return to posts index

Reuben Martin
Re: Splitting 14 channels into 14 tracks
on Oct 16, 2012 at 5:40:35 pm

I think your right. I created a test file with a video and a 16 channel audio stream. I created it with ffmpeg btw. It can _create_ the 16 channel audio stream, but the filter subsystem doesn't like it when I feed it back in to try to split the channels out. Gives errors about invalid channel layout.

Hopefully the developers will make a matrix filter in the future to be able to map any input:stream:channel to any output:stream:channel that isn't constrained by channel layout presets.


Return to posts index


Kevin Wells
Re: Splitting 14 channels into 14 tracks
on Apr 8, 2014 at 9:41:14 am

Hi, I am trying to export all audio channels from a quicktime file which has the following audio configuration:

Track 1 - mono
Track 2 - mono
Track 3 - mono
Track 4 - mono
Track 5 - mono
Track 6 - mono
Track 7 - stereo

I am using:

CODE: SELECT ALL
ffmpeg -i Feature.mov -map 0:1 -y Left.wav -map 0:2 Right.wav -map 0:3 Center.wav -map 0:4 LFE.wav -map 0:5 Left_Surround.wav -map 0:6 Right_Surround.wav -map 0.7 Left_Total.wav -map 0.8 Right_Total.wav


But this is giving me an error, 'Data stream encoding not supported yet (only streamcopy)'.
So I want to output 6 mono wavs and 1 stereo wav.
How do I do that?

Kind regards.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]