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.mp4When to use it
- adding music
- voiceover clips
- replacing silent video audio
How it works
- Upload both the video and audio files.
- Set the second input filename to match the uploaded audio file.
- Run FFmpeg and download the combined MP4.
Option reference
| Option | What it does |
|---|---|
-i audio.mp3 | Adds a second input file for the audio track. |
-c:v copy | Copies the original video stream. |
-shortest | Stops 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.