Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Compression Techniques Need info ffmpeg audio manipulation

  • Need info ffmpeg audio manipulation

    Posted by Serge Dumoulin on April 6, 2018 at 3:49 pm

    I have and input file with 2 stereo stream of audio.
    I am trying to mixdown the audio:
    first stereo stream mixdown to left channel of a single stereo stream
    Second stereo stream mixdown to right channel of the same stereo stream.
    So output file have only one stereo stream.
    I have tried different things but its not clear how to manage streams and channels inside them.

    thx

    Martin Fox replied 7 years, 8 months ago 3 Members · 4 Replies
  • 4 Replies
  • Dan Shott

    May 23, 2018 at 10:08 pm

    Hey Serge,

    Unfortunately, according to the ffmpeg documentation it doesn’t look like that’s possible.

    “Note that currently each output stream can only contain channels from a single input stream; you can’t for example use “-map_channel” to pick multiple input audio channels contained in different streams (from the same or different files) and merge them into a single output stream. It is therefore not currently possible, for example, to turn two separate mono streams into a single stereo stream. However splitting a stereo stream into two single channel mono streams is possible.”

    https://www.ffmpeg.org/ffmpeg.html#Audio-Options under 5.11 Advanced options

    -Dan

  • Serge Dumoulin

    May 23, 2018 at 11:59 pm

    Hello Dan, thanks for replying. I forgot to reply that i got an answer on another forum.
    here is the command that is in fact working. Pretty impressive command:

    -filter_complex “[0:a:0]pan=1c|c0=0.5*c0+0.5*c1[left];[0:a:1]pan=1c|c0=0.5*c0+0.5*c1[right];[left][right]amerge[a]” -map 0:v -map “[a]” -c:v copy -c:a pcm_s16le

    Serge

  • Dan Shott

    May 24, 2018 at 12:51 am

    Oh, awesome! I’m super new to this, but was trying to solve the same issue the other day and only got to the ffmpeg documentation. Now to figure out how to implement this into a python script ☺

  • Martin Fox

    September 3, 2018 at 12:53 am

    Where in iFFmpeg do you put that instruction? This would be really helpful as my exports are two mono files that I need to convert to a single stereo file- thanks

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy