DEV Community

Cover image for Merge video with audio using FFMPEG
Sergio Peris
Sergio Peris

Posted on • Originally published at sertxu.dev

Merge video with audio using FFMPEG

If you have two files, one with audio and one with video, you can use FFMPEG to merge them without re-encoding.

For this example, the video file will be video.mp4 and the audio will be audio.mp4.

To merge both files, you should use the following command:

ffmpeg -i video.mp4 -i audio.mp4 -c:v copy -c:a copy output.mp4
Enter fullscreen mode Exit fullscreen mode

Once finished, the output.mp4 file will contain both audio and video together.

Top comments (0)