FFmpeg Cookbook

Add BGM / Audio Mix Tool

Add background music to a video. Adjust source vs BGM volume, fade in/out, and looping.

Local processing — no upload
🎬
Video file
MP4 / MOV / WebM
🎵
BGM audio
MP3 / WAV / AAC / M4A / OGG
Original audio volume 100%
BGM volume 50%
If the source video has no audio, set "Original audio volume" to 0% and turn on BGM looping to overlay BGM on a silent clip.
Processing… 0%
Popular uses
Add background musicMix with narrationTune fades

What this tool does

  • Mix the original track and BGM with independent volumes
  • Auto-loop BGM that is shorter than the video
  • Fade-in / fade-out in seconds
  • Trim output to video length or to BGM length
  • Accepts MP3 / WAV / M4A / AAC / Ogg

How to use

  1. 1

    Pick a video and BGM

    Drop the video and the audio track separately.

  2. 2

    Set the mix balance

    100% original / 25–50% BGM is a good starting point for narrated content.

  3. 3

    Configure fades and loop

    Fade-in 1–2s, fade-out 2–3s. Toggle loop on for short BGMs.

  4. 4

    Run the mix

    Download once the preview shows up.

What each setting means

Original volume
Volume of the source audio. 0% mutes the original entirely.
BGM volume
Volume of the added track. 25–50% keeps speech audible.
Fade in / out
Duration of the audio fade in seconds.
Loop BGM
Repeats short tracks until the video ends.
Output length
Trim to video length or to BGM length.

Recommended settings

Vlog / explainer with narration
Original 100% / BGM 25% · fade 2s · loop on
Keeps narration intelligible and avoids gaps in long clips.
Music-only edit (no original audio)
Original 0% / BGM 80% · fade 2s
Strips environmental noise and lets the music carry the clip.
TikTok / Shorts SFX punch-in
Original 70% / BGM 100% · fade 0s
Snap effects benefit from no fade.

Common pitfalls

Symptom: BGM ends before the video

Cause: BGM is shorter than the video and loop is off.

Fix: Enable the “Loop BGM” toggle.

Symptom: Distortion / clipping

Cause: Combined levels exceed 0 dBFS.

Fix: Drop BGM to ≤50% or run output through the Volume Normalizer.

Symptom: Fade does not apply

Cause: Fade duration is longer than the BGM itself.

Fix: Keep fade ≤ BGM length.

Equivalent FFmpeg commands

Reference commands you can run on the desktop FFmpeg CLI.

Mix BGM with the original audio
ffmpeg -i video.mp4 -i bgm.mp3 -filter_complex "[0:a]volume=1[a0];[1:a]volume=0.3,afade=t=in:st=0:d=2,afade=t=out:st=58:d=2[a1];[a0][a1]amix=inputs=2:duration=first[a]" -map 0:v -map "[a]" -c:v copy out.mp4
volume=0.3 → 30% BGM, with 2s fades.
Loop a short BGM under a longer video
ffmpeg -i video.mp4 -stream_loop -1 -i bgm.mp3 -filter_complex "[0:a]volume=1[a0];[1:a]volume=0.3[a1];[a0][a1]amix=inputs=2:duration=first[a]" -map 0:v -map "[a]" -c:v copy -shortest out.mp4
-stream_loop -1 loops indefinitely; -shortest stops at the video.

Browser support & limits

  • Recommended max: video 500 MB / BGM 100 MB
  • Audio formats: MP3 / WAV / M4A / AAC / Ogg
  • Video codec: H.264 (mp4) only

Privacy

This tool runs ffmpeg.wasm directly in your browser. Files never leave your device — everything runs locally. Read the privacy policy →

Frequently asked questions

Where can I find royalty-free BGM?

YouTube Audio Library, Free Music Archive, Pixabay Music, and Bensound are popular options. Always verify commercial-use rights on the source page.

How do I mute the original audio?

Set Original Volume to 0%. Only the BGM remains.

Can I sequence multiple BGM tracks?

This tool mixes one BGM per pass. Concatenate audio tracks externally first if you need a sequence.

Audible click at loop boundaries

Looping BGMs that aren’t mastered for seamless looping will pop. Pick a loop-ready file or set a 0.5s fade-out at the loop point.

Mono BGM?

Yes — mono and stereo are auto-converted to stereo.

Output format?

MP4 (H.264 video copied + AAC audio re-mixed). Original video is not re-encoded.

Related tools

Related FFmpeg recipes