ffmpeg take channels 7+8 and make a stereo I have a 8 audio track mov file which I want to encode to mp4 using ffmpeg BUT take the tracks 7+8 and put them as stereo with 320k and 48KHz to that mp4. My line is this:

ffmpeg -i %source% -map 0:0 -map 0:7 -map 0:8 -c:a:0 aac -ab:1 320k -ar:1 48000 -ac:1 2 -disposition:a:0 default -c:a:1 aac -ab:2 320k -ar:2 48000 -ac:2 1 -disposition:a:1 0 -strict -2 -async 1 -c:v libx264 -b:v 9300k -minrate 9300k -maxrate 9300k -bufsize 2325k -r 24 -force_fps -s 1920x1080 -aspect 1:1 -pix_fmt yuv420p -profile:v high -preset medium -level 40 -partitions partb8x8+partp4x4+partp8x8+parti8x8 -b-pyramid 2 -weightb 1 -8x8dct 1 -fast-pskip 1 -direct-pred 1 -x264-params force-cfr=1 -coder ac -trellis 1 -me_method hex -flags +loop -sc_threshold 40 -keyint_min 24 -g 240 -qmin 3 -qmax 51 -threads 12 -metadata creation_time=now -sn -y %source%_FINAL.mp4


What do I have to change in order to make it stereo instead of 2 mono? I tried adding-filter_complex "[0:7][0:8] amerge=inputs=2" c:a aac -ab 320k at the beginning but it didnt work. What am I doing wrong? Thanks.
Try something like this:

1) Merge Audio Tracks 7 and 8, put it in Audio Track 1, discard other Audio Tracks from source:

ffmpeg -i "in.mxf" -filter_complex "[0:7][0:8]amerge=inputs=2[mergedAudio]" -map 0:v -map "[mergedAudio]" "out.mp4"


In some cases you might add the option -ac 2 between the end-" of filter complex and the 1st map.

2) 1) combined with all (useful) parameters of your code:

ffmpeg -i "in.mov" -filter_complex "[0:7][0:8]amerge=inputs=2[mergedAudio]" -map 0:v -map "[mergedAudio]" -ac 2 -c:a aac -b:a 320k -ar 48000 -disposition:a:0 default -strict -2 -c:v libx264 -b:v 9300k -minrate 9300k -maxrate 9300k -bufsize 2325k -r 24 -force_fps -s 1920x1080 -aspect 1:1 -pix_fmt yuv420p -profile:v high -preset medium -level 40 -partitions partb8x8+partp4x4+partp8x8+parti8x8 -b-pyramid 2 -weightb 1 -8x8dct 1 -fast-pskip 1 -direct-pred 1 -x264-params force-cfr=1 -coder ac -trellis 1 -me_method hex -flags +loop -sc_threshold 40 -keyint_min 24 -g 240 -qmin 3 -qmax 51 -threads 12 -metadata creation_time=now -sn -y FINAL.mp4


You had a space in your bitrate -ab:1 320k. I have changed it to the current syntax -b:a 320k

Same with -ar:1 48000 -> -ar 48000

Removed -async 1 because it threw an error