<p>First, <a href="https://ffmpeg.org/download.html">get <code>ffmpeg</code></a>.</p>

<p>Generally, you want to give YouTube the highest quality you can because it will re-encode anything you give it, but the formats used in MXF can be mental for uploading. So re-encoding to modern formats for a more manageable upload often makes sense.</p>

<h2>Example</h2>

<pre><code>ffmpeg -i input.mxf \
-filter_complex "[0:a:0][0:a:1]amerge" \
-ac 2 -c:v libx264 -crf 18 -c:a libvorbis output.mkv
</code></pre>

<h2>What these options do</h2>

<ul>
<li><p><code>-filter_complex "[0:a:0][0:a:1]amerge[a]"</code> – Take the two audio streams and combine them with <a href="https://ffmpeg.org/ffmpeg-filters.html#amerge">amerge filter</a> into one, multichannel stream.</p>

<ul>
<li>The <code>[0:a:1]</code> refers to <code>[input file index:stream specifier:stream index]</code>, so <code>[0:a:1]</code> is the second audio stream from the first input file (<code>input.mxf</code>).</li>
</ul></li>
<li><p><code>-ac 2</code> – Downmix audio to stereo.</p></li>
<li><p><code>-c:v libx264</code> – Encode video to H.264. See <a href="https://trac.ffmpeg.org/wiki/Encode/H.264">more info and examples</a>.</p>

<ul>
<li><code>-crf 18</code> – libx264 option to make output roughly "visually lossless".</li>
</ul></li>
<li><p><code>-c:a libvorbis</code> – Encode audio to Vorbis.</p></li>
<li><p><code>output.mkv</code> – Output to Matroska container format. It will not be playable in WMP or QuickTime, but who cares. YouTube will, and YouTube is all that matters in this case. VLC, mpv, or MPC-HC will be able to play it.</p></li>
</ul>

<h2>Keeping it as MXF</h2>

<p>If you want MXF for whatever reason:</p>

<pre><code>ffmpeg -i input.mxf \
-filter_complex "[0:a:0][0:a:1]amerge[a]" \
-map 0:v -map "[a]" -ac 2 -c:v copy -c:a pcm_s16le output.mxf
</code></pre>

<ul>
<li><p>The video will be <a href="https://ffmpeg.org/ffmpeg.html#Stream-copy">stream copied</a> (re-muxed). <strong>No re-encoding</strong>, so it will be fast and preserve quality.</p></li>
<li><p>MXF is picky, so the <code>-map</code> option is used to arrange the output streams in a MXF friendly order.</p></li>
</ul>

CC BY-SA 3.0
2015-10-04T18:46:01.813Z
2015-10-04T18:46:01.813Z
llogan
<p>We recorded video from our last event with 2 sources (1 mic by speakers) and we now have to handle MXF files with 2 diferent sources.</p>

<p>I need to upload this video file on Youtube, it work but it only take the first audio source. </p>

<p>Any (Simple) way to merge this two audio sources ?</p>

<p>Regards,</p>

<audio><youtube>
Handle 2 sources in a video file
Sauget Charles-Henri
# Handle 2 sources in a video file

(Asked by: username_0 on 2015-10-04)

We recorded video from our last event with 2 sources (1 mic by speakers) and we now have to handle MXF files with 2 diferent sources.

I need to upload this video file on Youtube, it work but it only take the first audio source.

Any (Simple) way to merge this two audio sources ?

Regards,

**Tags:** audio, youtube


---

## 1 answers

### Answer by username_1 on 2015-10-04. Score: 5 | Accepted answer

First, get ffmpeg.
Generally, you want to give YouTube the highest quality you can because it will re-encode anything you give it, but the formats used in MXF can be mental for uploading. So re-encoding to modern formats for a more manageable upload often makes sense.
Example
ffmpeg -i input.mxf \
-filter_complex "[0:a:0][0:a:1]amerge" \
-ac 2 -c:v libx264 -crf 18 -c:a libvorbis output.mkv

What these options do

-filter_complex "[0:a:0][0:a:1]amerge[a]" – Take the two audio streams and combine them with amerge filter into one, multichannel stream.

The [0:a:1] refers to [input file index:stream specifier:stream index], so [0:a:1] is the second audio stream from the first input file (input.mxf).

-ac 2 – Downmix audio to stereo.
-c:v libx264 – Encode video to H.264. See more info and examples.

-crf 18 – libx264 option to make output roughly "visually lossless".

-c:a libvorbis – Encode audio to Vorbis.
output.mkv – Output to Matroska container format. It will not be playable in WMP or QuickTime, but who cares. YouTube will, and YouTube is all that matters in this case. VLC, mpv, or MPC-HC will be able to play it.

Keeping it as MXF
If you want MXF for whatever reason:
ffmpeg -i input.mxf \
-filter_complex "[0:a:0][0:a:1]amerge[a]" \
-map 0:v -map "[a]" -ac 2 -c:v copy -c:a pcm_s16le output.mxf


The video will be stream copied (re-muxed). No re-encoding, so it will be fast and preserve quality.
MXF is picky, so the -map option is used to arrange the output streams in a MXF friendly order.


---

