Search code examples
audioffmpegaudio-streamingffplay

ffplay - route incoming audio stream to specific channels / convert channel layout


i need to play a mp3 stream (stereo) via ffplay and send it to specific output channels on my multichannel audio hardware.

stream (stereo) -> output 3 & 4 while doing that the unused channels should stay silent, as i want to send to them from other instances of ffplay.

how would i go about to do that?

i already tried a lot of different approaches without luck, mostly based on this:

ffplay -i http://blablabla -af 'channelmap=map=0-2|1-3' -nodisp

as well as

ffplay -i http://blablabla -af 'channelmap=map=0-2|1-3=channel_layout=6.0'

thank you for any help, i'm slowly going crazy digging through the manuals and trying out variations of the same command for hours … 😵‍💫

ps: i'm running ffplay 5.1.1 on mac os 12.5.1 on m1max


Solution

  • i figured it out myself – in case anyone is interested:

    ffmpeg -i http://locus.creacast.com:9001/brno_luzanky.mp3 -i https://orf-live.ors-shoutcast.at/oe1-q2a -i https://securestream.o94.at/live.mp3 -filter_complex "[0:a][1:a][2:a]join=inputs=3:channel_layout=5.1:map=0.0-FL|0.1-FR|1.0-FC|1.1-LFE|2.0-BL|2.1-BR[a]" -map "[a]" -f wav - |ffplay -
    

    the solution goes further than the question. it does this: receive 3 different webradio streams, combine them into one and send them simultaneously in one 6-channel audio stream to the audio interface.