Browser FFmpeg recipe
Merge Audio and Video Online with FFmpeg
Pair a video stream with a separate audio track in a single MP4.
Command
Run this FFmpeg command
ffmpeg -i silent-video.mp4 -i track.m4a -c:v copy -c:a aac -map 0:v:0 -map 1:a:0 audio-video.mp4When to use it
- silent video exports
- music tracks
- screen recordings
How it works
- Upload the silent video and audio track.
- Edit track.m4a if your audio file has a different name.
- Run the command and download the merged file.
Option reference
| Option | What it does |
|---|---|
-c:v copy | Keeps the original video stream. |
-c:a aac | Encodes the audio to AAC for MP4 compatibility. |
-map 0:v:0 -map 1:a:0 | Selects video from input 0 and audio from input 1. |
Practical notes
- If the audio is longer than the video, add -shortest to stop at the video end.
- AAC audio works well for browser and phone playback.
FAQ
Is this different from add audio to video?
It is similar, but this page focuses on pairing a silent video with a separate track.
Why encode audio?
AAC is broadly compatible with MP4 players and upload platforms.