Browser FFmpeg recipe

Combine Video and Audio Online with FFmpeg

Create an MP4 with video from the first input and audio from the second input.

Command

Run this FFmpeg command

ffmpeg -i video.mp4 -i audio.mp3 -map 0:v:0 -map 1:a:0 -c:v copy -c:a aac -shortest combined.mp4

When to use it

  • separate tracks
  • voiceovers
  • music overlays

How it works

  1. Upload the video and audio files.
  2. Change audio.mp3 to the uploaded audio filename if needed.
  3. Run FFmpeg and download the combined output.

Option reference

OptionWhat it does
-map 0:v:0Uses the first video stream from the first input.
-map 1:a:0Uses the first audio stream from the second input.
-shortestStops when the shorter stream ends.

Practical notes

  • This command replaces existing audio by mapping the second input's audio.
  • Remove -shortest if you need the full video duration preserved.

FAQ

Does this keep the original video quality?

Yes, the video stream is copied when the output container supports it.

Can I keep both old and new audio?

Yes, but you need to map both audio streams explicitly.