[FFmpeg-user] audio channel manipulation

Moritz Barsnick barsnick at gmx.net
Mon Jan 21 21:45:59 EET 2019

On Mon, Jan 21, 2019 at 14:01:52 -0500, Jim Shupert wrote:
> if it is in 4 streams you can pick which to hear.
> My capture system captures 10bit unc mov video [0:0]  ( 4ch_test.mov )
> and the 4 audio "tracks" are found in 1 stream as 4 channels [0:1.0 , 
> 0:1.1, 0:1.2, 0:1.3 ]

Do you need the intermediate file 4s_b.avi? (I assume so, but your
final file 4s_b.mp4 can be created in one step, if that is desired.)

> ---------------------------:: make the ffv1 avi from the 10b mov  capture .
> 4s_b.avi
> ffmpeg -i 4ch_test.mov -vcodec ffv1 -level 3 -coder 1 -pix_fmt 
> yuv422p10le -aspect 4:3 -g 1 \
>   -filter_complex "[0:a]pan=mono|c0=c0[a0]; [0:a]pan=mono|c0=c1[a1]; 
> [0:a]pan=mono|c0=c2[a2]; [0:a]pan=mono|c0=c3[a3]" \
>   -map 0:v -map "[a0]" -map "[a1]" -map "[a2]" -map "[a3]" -map 0:d -c 
> copy -c:a pcm_s24le -f avi 4s_b.avi

Your filter
  "[0:a]pan=mono|c0=c0[a0]; [0:a]pan=mono|c0=c1[a1]; [0:a]pan=mono|c0=c2[a2]; [0:a]pan=mono|c0=c3[a3]"
is indeed a neat trick to separate your channels into streams. There's
an easier way though: The "channelsplit" filter:

The second filter ("[0:1] [0:2] amerge") is just fine for creating
stereo from two separate channels.

> https://trac.ffmpeg.org/wiki/AudioChannelManipulation

Apparently, you read the section "stereo → 2 × mono files". My
suggestion with the "channelsplit" is right below, in the section
"stereo → 2 × mono streams". Actually, both filters will work either
way, the examples are quite arbitrary, come to think of it.


More information about the ffmpeg-user mailing list