Browser FFmpeg recipe

Add Audio to Video Online with FFmpeg

Create a video that uses the original video stream and a separate audio track.

Command

Run this FFmpeg command

ffmpeg -i input.mp4 -i audio.mp3 -c:v copy -c:a aac -shortest video-with-audio.mp4

When to use it

  • adding music
  • voiceover clips
  • replacing silent video audio

How it works

  1. Upload both the video and audio files.
  2. Set the second input filename to match the uploaded audio file.
  3. Run FFmpeg and download the combined MP4.

Option reference

OptionWhat it does
-i audio.mp3Adds a second input file for the audio track.
-c:v copyCopies the original video stream.
-shortestStops the output when the shorter input ends.

Practical notes

  • The uploaded audio filename must match the second -i value.
  • Remove -shortest if you want the output to keep the full video duration.

FAQ

Can I replace existing audio?

Yes. This command maps the new audio by using the second input. For complex files, add explicit -map options.

Why does the output stop early?

The -shortest option ends the output when the shorter input ends.