Answers.Body: <p>Try something like this:</p>
  
  <p><strong>1) Merge Audio Tracks 7 and 8, put it in Audio Track 1, discard other Audio Tracks from source:</strong></p>
  
  <pre><code>ffmpeg -i "in.mxf" -filter_complex "[0:7][0:8]amerge=inputs=2[mergedAudio]" -map 0:v -map "[mergedAudio]" "out.mp4"
  </code></pre>
  
  <p>In some cases you might add the option <code>-ac 2</code> between the end-<code>"</code> of filter complex and the 1st <code>map</code>.</p>
  
  <p><strong>2) <code>1)</code> combined with all (useful) parameters of your code:</strong></p>
  
  <pre><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
  </code></pre>
  
  <p>You had a space in your bitrate <code>-ab:1 320k</code>. I have changed it to the current syntax <code>-b:a 320k</code></p>
  
  <p>Same with <code>-ar:1 48000</code> -> <code>-ar 48000</code></p>
  
  <p>Removed <code>-async 1</code> because it threw an error</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-02T09:52:14.807Z
Answers.Text: Thanks drake7 but where do I put it to the above long line so I have everything I need (video and audio) in one command? I tried it but did not work. Thanks.
Answers.UserDisplayName: Yannis
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-02T10:00:53.713Z
Answers.Text: Can you provide your file? If it's too big you can limit the duration to 5 seconds: `ffmpeg -i "in.mxf" -map 0 -c copy -t 5 "sample10s.mxf` (I assume it's `.mxf` but use whatever file extension your source has)
Answers.UserDisplayName: drake7
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-02T13:30:51.310Z
Answers.Text: I can but how should I send it to you?
Answers.UserDisplayName: Yannis
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-02T15:15:10.727Z
Answers.Text: You can e-mail me with a service like [wetransfer](https://wetransfer.com/) or upload it to something like [uploadfiles.io](https://uploadfiles.io/).
  I've added my e-mail to my profile info.
Answers.UserDisplayName: drake7
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-02T15:59:32.450Z
Answers.Text: Thanks Drake, I just did on your email.
Answers.UserDisplayName: Yannis
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-02T16:16:00.190Z
Answers.Text: got it! I'll get back to you soon
Answers.UserDisplayName: drake7
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-02T16:18:21.420Z
Answers.Text: Thanks! so the whole idea is to use that line for the video (which works great) but grab the CH7+8 from the mov file and encode them as stereo in aac 320k and 48KHz and add to the final mp4. The audio command on its own works but when I add it on the above big line it pops errors.
Answers.UserDisplayName: Yannis
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-03T08:05:47.430Z
Answers.Text: Thanks drake! That worked like a charm!
Answers.UserDisplayName: Yannis
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-03T09:45:30.990Z
Answers.Text: Glad to hear that, you're welcome. I wasn't sure if you wanted more than 1 audio track because I saw the `-disposition` option in your parameters. That makes sense if you have multiple audio/subtitle tracks. Adding a 2nd track would be easy by the way. Furthermore you have lots of parameters that I would only use if a client would have these specific requirements. Otherwise the defaults for video codec `libx264` are pretty good both in quality as well as compatibility.
Answers.UserDisplayName: drake7
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-03T09:49:44.210Z
Answers.Text: Thanks Drake! You are correct, those settings came from the client/digital platform so I can't do much about it! No, the disposition must have been a leftover from another line! I might get rid of it. Thanks again!!!
Answers.UserDisplayName: Yannis
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-01T21:06:26.460Z
Answers.LastActivityDate: 2020-04-03T09:52:35.063Z
Answers.LastEditDate: 2020-04-03T09:52:35.063Z
Answers.UserDisplayName: drake7
Body: <p>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:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>What do I have to change in order to make it stereo instead of 2 mono? I tried adding<code>-filter_complex "[0:7][0:8] amerge=inputs=2" c:a aac -ab 320k</code> at the beginning but it didnt work. What am I doing wrong? Thanks.</p>
  
Tags: <video><ffmpeg><audio>
Title: ffmpeg take channels 7+8 and make a stereo
UserDisplayName: Yannis
ThreadText: # ffmpeg take channels 7+8 and make a stereo
  
  (Asked by: username_0 on 2020-04-01)
  
  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.
  
  **Tags:** video, ffmpeg, audio
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-04-01. Score: 0 | Accepted answer
  
  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
  
  > **Comments:**
  > **username_0**: Thanks username_1 but where do I put it to the above long line so I have everything I need (video and audio) in one command? I tried it but did not work. Thanks.  
  > **username_1**: Can you provide your file? If it's too big you can limit the duration to 5 seconds: `ffmpeg -i "in.mxf" -map 0 -c copy -t 5 "sample10s.mxf` (I assume it's `.mxf` but use whatever file extension your source has)  
  > **username_0**: I can but how should I send it to you?  
  > **username_1**: You can e-mail me with a service like [wetransfer](https://wetransfer.com/) or upload it to something like [uploadfiles.io](https://uploadfiles.io/). I've added my e-mail to my profile info.  
  > **username_0**: Thanks Drake, I just did on your email.  
  > **username_1**: got it! I'll get back to you soon  
  > **username_0**: Thanks! so the whole idea is to use that line for the video (which works great) but grab the CH7+8 from the mov file and encode them as stereo in aac 320k and 48KHz and add to the final mp4. The audio command on its own works but when I add it on the above big line it pops errors.  
  > **username_0**: Thanks drake! That worked like a charm!  
  > **username_1**: Glad to hear that, you're welcome. I wasn't sure if you wanted more than 1 audio track because I saw the `-disposition` option in your parameters. That makes sense if you have multiple audio/subtitle tracks. Adding a 2nd track would be easy by the way. Furthermore you have lots of parameters that I would only use if a client would have these specific requirements. Otherwise the defaults for video codec `libx264` are pretty good both in quality as well as compatibility.  
  > **username_0**: Thanks Drake! You are correct, those settings came from the client/digital platform so I can't do much about it! No, the disposition must have been a leftover from another line! I might get rid of it. Thanks again!!!  
  
  ---
  
  