<p><a href="http://www.ffmpeg.org/download.html" rel="noreferrer">ffmpeg</a> looks promising. Might be worth a shot.</p>

<p>Specifically, the <a href="https://www.youtube.com/watch?v=eXfp4S1xZsw" rel="noreferrer">command</a></p>

<pre><code>ffmpeg -i video.mp4 -i audio.m4a -acodec copy -vcodec copy output.mp4
</code></pre>

<p>should do the trick.</p>

CC BY-SA 4.0
2016-09-02T13:06:22.327Z
2018-12-20T20:26:36.457Z
2018-12-20T20:26:36.457Z
sgryzko
<p><a href="http://www.videohelp.com/tools/MP4Muxer" rel="nofollow">MP4muxer</a> will do the job, it even takes raw h264 streams.</p>

<p>This process is usually called "muxing" and can be done with virtually any container format.
Of course audio and video has to have the exact same length to have synchronized audio and video.</p>

CC BY-SA 3.0
2014-06-09T13:53:14.877Z
2014-06-09T14:26:46.367Z
2014-06-09T14:26:46.367Z
timonsku
<p>If your output container can handle the relevant codecs, then you can simply copy both audio and video streams using ffmpeg:</p>

<pre><code>ffmpeg -i video.mp4 -i audio.m4a -c copy output.mp4
</code></pre>

CC BY-SA 4.0
2018-07-19T16:05:26.020Z
Thanks, but how does it differs from the answer of the sgryzko?
Slava Fomin II
CC BY-SA 4.0
2018-07-20T20:44:15.790Z
It is simplified, yet provides the same resultant function.
ransur0t
CC BY-SA 4.0
2018-07-19T13:37:19.040Z
2018-07-19T13:37:19.040Z
ransur0t
<p>I have two files, one is <strong>MP4</strong> file with video only and another is <strong>M4A</strong> audio file. What is the best and simpliest method of merging these two tracks in a single MP4 container? Is it possible to do this without transcoding (loosing quality)? Thanks!</p>

<p>Open source and free software is my preference.</p>

CC BY-SA 3.0
2014-06-09T13:28:35.513Z
Do they actually line up correctly or do you also need to synchronize them?  If it is synced, this is effectively a duplicate of http://video.stackexchange.com/questions/10730/combine-video-and-audio-ts-segments-coming-from-hls-stream/.  Different source for the streams, but same solution should work.
AJ Henderson
CC BY-SA 3.0
2014-06-09T13:48:44.327Z
I wouldn't say its a 100% duplicate. While the answer works, there are also other tools specifically for MP4.
The question might help people that search specifically for MP4 merging.
timonsku
CC BY-SA 3.0
2014-06-09T14:25:43.920Z
Scratch that, tsMuxer only allows MP4 as input not as output.
timonsku
<software-recommendation><mp4>
Merge MP4 with M4A
Slava Fomin II
# Merge MP4 with M4A

(Asked by: username_0 on 2014-06-09)

I have two files, one is **MP4** file with video only and another is **M4A** audio file. What is the best and simpliest method of merging these two tracks in a single MP4 container? Is it possible to do this without transcoding (loosing quality)? Thanks!

Open source and free software is my preference.

**Tags:** software-recommendation, mp4

> **Comments:**
> **username_1**: Do they actually line up correctly or do you also need to synchronize them?  If it is synced, this is effectively a duplicate of http://video.stackexchange.com/questions/10730/combine-video-and-audio-ts-segments-coming-from-hls-stream/.  Different source for the streams, but same solution should work.  
> **username_2**: I wouldn't say its a 100% duplicate. While the answer works, there are also other tools specifically for MP4. The question might help people that search specifically for MP4 merging.  
> **username_2**: Scratch that, tsMuxer only allows MP4 as input not as output.  

---

## 3 answers

### Answer by username_3 on 2016-09-02. Score: 17

ffmpeg looks promising. Might be worth a shot.
Specifically, the command
ffmpeg -i video.mp4 -i audio.m4a -acodec copy -vcodec copy output.mp4

should do the trick.


---

### Answer by username_2 on 2014-06-09. Score: 3

[MP4muxer](http://www.videohelp.com/tools/MP4Muxer) will do the job, it even takes raw h264 streams.

This process is usually called "muxing" and can be done with virtually any container format.
Of course audio and video has to have the exact same length to have synchronized audio and video.


---

### Answer by username_4 on 2018-07-19. Score: 2

If your output container can handle the relevant codecs, then you can simply copy both audio and video streams using ffmpeg:
ffmpeg -i video.mp4 -i audio.m4a -c copy output.mp4

> **Comments:**
> **username_0**: Thanks, but how does it differs from the answer of the username_3?  
> **username_4**: It is simplified, yet provides the same resultant function.  

---

