lu-zero / bmdtools

Basic capture and play programs for Blackmagic Design Decklink
Boost Software License 1.0
198 stars 74 forks source link

Single stream with 8/16 Channel Audio to 4/8 Stereo Pairs #74

Closed maselive closed 8 years ago

maselive commented 8 years ago

Hi Lu,

I've been banging my head against the wall for a while now on this. We're currently using BMDTools with AVConv 11.4.

I've created a mutli channel audio file but am having a real nightmare trying to map the single stream of 8 channel audio into separate streams of 4 stereo pairs.

Currently Stream 1 = Channels 1-8

Wanted Stream 1 - Channel 1&2 Stream 2 - Channel 3&4 Stream 3 - Channel 5&6 Stream 4 - Channel 7&8

We've been so far trying with channelsplit (-filter_complex channelsplit=channel_layout=8c) but get this error "Failed to configure output pad on auto-inserted resampler 1"

Was wondering if you might be the man to shed any light on where we're going wrong?

Cheers.

wieshka commented 8 years ago

Take a look with mapping, you can -map particular channels to particular outputs

maselive commented 8 years ago

Thanks for the reply Wieshka.

I thought that you could only map channels if they were separate streams but will give that a go and report back.

maselive commented 8 years ago

Hi Wieshka,

I've been playing with mapping today and am able to get multiple streams out from my input file which is great. Currently though each new stream is a mono mix containing all 8 channels from our input audio stream #0:1 (Stream #0.0 being video and #0:1 our audio with 8 individual channels)

Using -map 0:1:0 \ -map 0:1:1 \ -map 0:1:2 \ -map 0:1:3 \ -map 0:1:4 \ -map 0:1:5 \ -map 0:1:6 \ -map 0:1:7 \

What I believe I need to do, to access each individual channel within our single audio stream and map them to its desired stream or is the solution to use channel split and then map from there?

As a background, these aren't to be made into separate files but delivered as a single stream of video with 4 selectable channels of stereo audio as per below.

Stream 0:1.0 - Stream 1 Channel 1 Stream 0:1.1 - Stream 1 Channel 2

Stream 0:1:2 - Stream 2 Channel 1 Stream 0:1:3 - Stream 2 Channel 2

Stream 0:1:4 - Stream 3 Channel 1 Stream 0:1:5 - Stream 3 Channel 2

Stream 0:1:6 - Stream 4 Channel 1 Stream 0:1:7 - Stream 4 Channel 2

Thanks in advance for any assistance.

amnonbb commented 8 years ago

-map 0:v -map 0:a -map 0:a -map 0:a -map 0:a \ -c:0 VIDEOCODEC \ -filter:1 pan=0x3|c0=c0|c1=c1 -c:1 AUDIOCODEC -ac:1 2 -b:1 224k \ -filter:2 pan=0x3|c0=c2|c1=c3 -c:2 AUDIOCODEC -ac:2 2 -b:2 224k \ -filter:3 pan=0x3|c0=c4|c1=c5 -c:3 AUDIOCODEC -ac:3 2 -b:3 224k \ -filter:4 pan=0x3|c0=c6|c1=c7 -c:4 AUDIOCODEC -ac:4 2 -b:4 224k

i'm using ffmpeg, but i think in avconv it's should work

maselive commented 8 years ago

Hi Amnonbb,

Unfortunately there is no Pan in AVConv so think that rules that workflow out for me.

Thanks for your help.

amnonbb commented 8 years ago

Chekck channelmap filter https://libav.org/documentation/libavfilter.html#channelmap

I think it' will do same work

maselive commented 8 years ago

Hi all,

Thank you all very much for your help. -Channelmap was what we needed. It took a while for us to work out the correct syntax.

Thanks for the hints.