Thomas' Tech Tips

Merge video and audio files into one a single mp4 file

14 July 2023 - Thomas Damgaard

I sometimes receive video files in separate audio and video components. Video is typically delivered as an MP4 file while audio is delivered either as an MP3 or an MP4 file. I then need to merge these into a single MP4 video file.

Below is how to do this using ffmpeg.

Marge MP4 video and MP3 audio

To merge a video file (video.mp4) and an audio file (audio.mp3) into a single video file with both the video and audio using ffmpeg, you can use the following command:

ffmpeg -i video.mp4 -i audio.mp3 -c:v copy -c:a aac -strict experimental output.mp4

Explanation of ffmpeg options:

Merge MP4 video and MP4 audio

To merge a video file (video.mp4) and an audio file (audio.mp4) into a single video file with both the video and audio using ffmpeg, you can use the following command:

ffmpeg -i video.mp4 -i audio.mp4 -c:v copy -c:a copy output.mp4

Explanation of options:

Filed under: audio, ffmpeg, howto, linux, multimedia, tips, video

Back to article list