← Home

Merge audio and video files

FFmpeg · Nov 23, 2024 · 1 min read

Merging audio and video files can be done efficiently using the ffmpeg tool. This process is often used when video and audio streams are stored in separate files and need to be combined into a single file.

The following ffmpeg command demonstrates how to merge a video file with an audio file into a single output file:

$ ffmpeg -i input_video.mp4 -i input_audio.mp3 -c:v copy -c:a aac -map 0:v:0 -map 1:a:0 output.mp4

The command contains multiple options:

Bibliography

Bellard, F. (2000). FFmpeg Documentation. FFmpeg Project. https://ffmpeg.org/documentation.html