-
-
Notifications
You must be signed in to change notification settings - Fork 38
BGM and Audio
Muhammad Naufal Rizqullah edited this page Jun 26, 2026
·
1 revision
OpenSource Clipping includes an automatic background music (BGM) system with two professional mixing modes.
- Gemini AI analyzes the clip content and suggests a mood (e.g.,
chill,epic,sad,upbeat,suspense) - The system picks a random MP3 from the matching mood folder in
assets/bgm/ - BGM is mixed with the clip audio using the selected mixing mode
- If the MP3 is shorter than the video, it's auto-looped seamlessly
BGM volume automatically lowers when the speaker is talking, then rises during pauses. This provides a professional effect like premium podcasts and YouTube videos.
python main.py --url "VIDEO_URL" --bgm-mode duckingBGM plays at a stable, low volume throughout the video without any dynamic adjustments. Best for content with few pauses.
python main.py --url "VIDEO_URL" --bgm-mode backgroundpython main.py --url "VIDEO_URL" --no-bgmPlace your royalty-free .mp3 files into the mood folders:
assets/
└── bgm/
├── chill/ # Relaxed / lofi music
│ ├── song1.mp3
│ └── song2.mp3
├── epic/ # Cinematic / action music
│ └── trailer.mp3
├── sad/ # Emotional / melancholic music
│ └── piano.mp3
├── suspense/ # Mystery / tension music
│ └── dark.mp3
└── upbeat/ # Energetic / happy music
└── pop.mp3
- You can place multiple MP3s in each folder — the system picks one randomly each time
- If the requested mood folder is empty, the system falls back to
chill/ - If
chill/is also empty, BGM is skipped entirely (same as--no-bgm) - MP3 files shorter than the video are auto-looped (
-stream_loop -1)
| Source | URL | Notes |
|---|---|---|
| Pixabay Music | pixabay.com/music | ⭐ Recommended — free, no attribution required |
| YouTube Audio Library | YouTube Studio → Audio Library | Safe from copyright strikes |
| Incompetech | incompetech.com | Kevin MacLeod — usually requires attribution |
- Base BGM volume:
0.25(25% of original volume) - Ducking mode uses FFmpeg's
sidechaincompressfilter - BGM is applied after segment trimming (if enabled) to ensure seamless audio across cuts
-
CLI Reference —
--bgm-mode,--no-bgm - Hook V2 & Segment Trimming — How BGM interacts with trimming