Tutorial

Merge Video and Audio with FFmpeg

Use this step-by-step guide to combine a video file and a separate audio file with FFmpeg.

Install FFmpeg (if not already installed):

Prepare your files

Place your files in one folder, for example:

  • video.mp4
  • audio.mp3

Then open a command prompt or terminal in that folder.

Merge video and audio

Run this command:

ffmpeg -i video.mp4 -i audio.mp3 -c:v copy -c:a aac -shortest output.mp4
  • -c:v copy
    keeps the video stream without re-encoding.
  • -c:a aac
    encodes audio in an MP4-compatible format.
  • -shortest
    ends output when the shorter stream ends.

If your audio is longer than your video, the result will not run longer than needed.