<p>Apparently by default ffmpeg only copies one stream of each type.  To tell it to copy all streams, you need <code>-map 0</code></p>

<p>So, this does it:</p>

<pre><code>ffmpeg -i "concat:a01.mxf|b02.mxf" -y -map 0 -c copy result.mxf
</code></pre>

CC BY-SA 3.0
2014-02-13T10:35:49.997Z
2014-02-13T10:35:49.997Z
fastmultiplication
<p>I have mxf files which went over the 2G limit, so were split up in the camera to produce two mxf files.  They have two audio streams, one from each mic, like this:</p>

<pre><code>Duration: 00:10:01.60, start: 0.000000, bitrate: 27165 kb/s
Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, bt709), 1440x1080 [SAR 4:3 DAR 16:9], max. 25000 kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn, 59.94 tbc
Stream #0:1: Audio: pcm_s16le, 48000 Hz, 1 channels, s16, 768 kb/s
Stream #0:2: Audio: pcm_s16le, 48000 Hz, 1 channels, s16, 768 kb/s
</code></pre>

<p>I know how to concatenate them with ffmpeg:</p>

<pre><code>ffmpeg -i "concat:a01.mxf|b02.mxf" -y -c copy result.mxf
</code></pre>

<p>But, this combines the audio streams and produces a file with just one, merged stream.</p>

<p>I also know how to split out the individual audio streams into individual files:</p>

<pre><code>ffmpeg -i a01.mxf -map 0:1 -vn one.aiff
ffmpeg -i a01.mxf -map 0:2 -vn two.aiff
</code></pre>

<p>Grabs the streams and correctly transfers them across untouched.</p>

<p>My question is, how to do this for the split up mxfs?  I could rip their sound, then join the video, then put the sound back in, but it seems really unnecessary, and there should be a way to use a big -map command to do all of this.</p>

<ffmpeg><conversion>
How to concatenate two mxf files with ffmpeg, preserving both audio channels?
fastmultiplication
# How to concatenate two mxf files with ffmpeg, preserving both audio channels?

(Asked by: username_0 on 2014-02-13)

I have mxf files which went over the 2G limit, so were split up in the camera to produce two mxf files.  They have two audio streams, one from each mic, like this:
Duration: 00:10:01.60, start: 0.000000, bitrate: 27165 kb/s
Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, bt709), 1440x1080 [SAR 4:3 DAR 16:9], max. 25000 kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn, 59.94 tbc
Stream #0:1: Audio: pcm_s16le, 48000 Hz, 1 channels, s16, 768 kb/s
Stream #0:2: Audio: pcm_s16le, 48000 Hz, 1 channels, s16, 768 kb/s

I know how to concatenate them with ffmpeg:
ffmpeg -i "concat:a01.mxf|b02.mxf" -y -c copy result.mxf

But, this combines the audio streams and produces a file with just one, merged stream.
I also know how to split out the individual audio streams into individual files:
ffmpeg -i a01.mxf -map 0:1 -vn one.aiff
ffmpeg -i a01.mxf -map 0:2 -vn two.aiff

Grabs the streams and correctly transfers them across untouched.
My question is, how to do this for the split up mxfs?  I could rip their sound, then join the video, then put the sound back in, but it seems really unnecessary, and there should be a way to use a big -map command to do all of this.

**Tags:** ffmpeg, conversion


---

## 1 answers

### Answer by username_0 on 2014-02-13. Score: 6

Apparently by default ffmpeg only copies one stream of each type.  To tell it to copy all streams, you need -map 0
So, this does it:
ffmpeg -i "concat:a01.mxf|b02.mxf" -y -map 0 -c copy result.mxf


---

