AI Music Services for Video Background Music¶
Purpose: Automated music generation for social media video content (TikTok, X, YouTube Shorts).
Last Updated: October 31, 2025
Quick Recommendation¶
USE: Mubert API ✅ - FREE tier: 25 tracks/month - Official REST API for automation - Commercial rights included - Instant generation (no queue) - Simple API key authentication
DO NOT USE: Suno AI ❌ - Requires Pro plan ($8/month) for API access - Free tier: No commercial rights - Not suitable for automation without paid plan
Service Comparison¶
Suno AI¶
Status: Explored but not recommended for automation
Account Details: - Email: codiedev42@gmail.com - Username: @codiedev42 - Login Method: Google OAuth - Signed Up: October 31, 2025
Pricing: - Free Tier: 50 credits/day (10 songs), NO commercial use - Pro Plan: $8/month (yearly billing), 2,500 credits/month (500 songs), commercial rights, API access - Premier Plan: $24/month, 10,000 credits (2,000 songs)
Pros: - High-quality music generation - Simple web interface - Google login available
Cons: - ❌ No official public API for free tier - ❌ Requires $8/month Pro plan for commercial rights - ❌ Requires $8/month Pro plan for API access - ❌ Not suitable for automation without paid plan
URLs: - Website: https://suno.com - API Docs: https://suno.com/api (Pro plan required)
Mubert API (RECOMMENDED)¶
Status: Recommended - not yet signed up
Account Details: - Email: NOT YET SIGNED UP - API Key: NOT YET OBTAINED
Pricing: - Free Tier: 25 tracks/month, commercial rights included ✅ - Creator Plan: $14/month, 500 tracks/month - Pro Plan: $39/month, 1,500 tracks/month
Pros: - ✅ FREE tier includes commercial rights - ✅ Official REST API designed for automation - ✅ Instant generation (no queue) - ✅ Simple API key authentication - ✅ 25 tracks/month sufficient for weekly posts
Cons: - Requires API key signup - Less known than Suno
URLs: - Website: https://mubert.com - API Docs: https://mubert.com/api - Signup: https://mubert.com/api
Automated Workflow (Mubert API)¶
Step 1: Sign Up for Mubert API¶
- Go to https://mubert.com/api
- Sign up for free account
- Get API key (PAT - Personal Access Token)
- Store API key securely in environment variables or credentials file
Step 2: Generate Background Music¶
#!/bin/bash
# generate-music.sh
API_KEY="YOUR_MUBERT_API_KEY"
DURATION=46 # seconds (match video duration)
TAGS="corporate,upbeat,educational,instrumental"
# Generate track
curl -X POST https://api-b2b.mubert.com/v2/RecordTrack \
-H "Content-Type: application/json" \
-d '{
"method": "RecordTrack",
"params": {
"pat": "'$API_KEY'",
"duration": '$DURATION',
"tags": "'$TAGS'",
"mode": "track"
}
}' | jq -r '.data.link' > music_url.txt
# Download MP3
wget -O background-music.mp3 "$(cat music_url.txt)"
Step 3: Add Music to Video with ffmpeg¶
#!/bin/bash
# add-music-to-video.sh
VIDEO_INPUT="vitamin-b12-deficiency-compliant-FINAL.mp4"
MUSIC_INPUT="background-music.mp3"
VIDEO_OUTPUT="b12-with-music.mp4"
ffmpeg -i "$VIDEO_INPUT" \
-i "$MUSIC_INPUT" \
-c:v copy \
-c:a aac \
-filter_complex "[1:a]volume=0.3[music];[0:a][music]amix=inputs=2:duration=shortest" \
-shortest \
"$VIDEO_OUTPUT"
echo "✅ Video with music created: $VIDEO_OUTPUT"
Audio Volume Notes:
- volume=0.3 = 30% music volume (background)
- Adjust between 0.2-0.5 depending on narration volume
- amix mixes original audio (narration) with background music
- duration=shortest ensures music doesn't extend beyond video
Step 4: Post to X (Twitter)¶
#!/bin/bash
# post-to-x.sh
VIDEO_FILE="b12-with-music.mp4"
POST_TEXT="🎬 NEW VIDEO IS LIVE! 🎬
Vitamin B12 Deficiency: 6 Warning Signs You Can't Ignore
😴 Fatigue
🖐️ Numbness/Tingling
😶 Pale Skin
👅 Swollen Tongue
😔 Depression
💓 Palpitations
Watch now! 👇
https://youtube.com/shorts/7t1pDSw-xYY
Track your B12 with Nutri-E! 💜
#VitaminB12 #Health #YouTube"
# Use Playwright MCP to upload video
# (implementation depends on X video upload API)
Full Automation Script¶
Create a single script that does all steps:
#!/bin/bash
# automated-video-with-music.sh
set -e # Exit on error
# Configuration
MUBERT_API_KEY="YOUR_API_KEY"
VIDEO_INPUT="$1"
POST_TEXT="$2"
VIDEO_DURATION=$(ffprobe -v error -show_entries format=duration \
-of default=noprint_wrappers=1:nokey=1 "$VIDEO_INPUT" | cut -d. -f1)
echo "🎵 Generating background music ($VIDEO_DURATION seconds)..."
curl -X POST https://api-b2b.mubert.com/v2/RecordTrack \
-H "Content-Type: application/json" \
-d '{
"method": "RecordTrack",
"params": {
"pat": "'$MUBERT_API_KEY'",
"duration": '$VIDEO_DURATION',
"tags": "corporate,upbeat,educational,instrumental",
"mode": "track"
}
}' | jq -r '.data.link' > /tmp/music_url.txt
echo "⬇️ Downloading music..."
wget -q -O /tmp/background-music.mp3 "$(cat /tmp/music_url.txt)"
echo "🎬 Adding music to video..."
OUTPUT_FILE="${VIDEO_INPUT%.mp4}-with-music.mp4"
ffmpeg -loglevel error -i "$VIDEO_INPUT" \
-i /tmp/background-music.mp3 \
-c:v copy \
-c:a aac \
-filter_complex "[1:a]volume=0.3[music];[0:a][music]amix=inputs=2:duration=shortest" \
-shortest \
"$OUTPUT_FILE"
echo "✅ Video with music created: $OUTPUT_FILE"
echo "📊 File size: $(du -h "$OUTPUT_FILE" | cut -f1)"
# Clean up
rm /tmp/music_url.txt /tmp/background-music.mp3
echo "📤 Ready to post to X!"
echo "Next: Use Playwright to upload $OUTPUT_FILE to X"
Usage:
Alternative: YouTube Audio Library¶
Status: Currently used for YouTube videos
Pros: - ✅ Completely free - ✅ Royalty-free, commercial use allowed - ✅ High-quality tracks - ✅ No API limits
Cons: - ❌ Manual selection and download required - ❌ Not suitable for automation - ❌ Must browse library to find matching tracks
Use Cases: - YouTube Shorts (already using "Statement" track) - When manual curation is acceptable - When specific mood/style is critical
Current Usage: - Vitamin B12 video: "Statement" (3:07) track added Oct 31, 2025 - See YOUTUBE_MUSIC_GUIDE.md for track selection process
Cost Analysis¶
Monthly Cost Comparison (for 8 videos/month)¶
| Service | Free Tier | Cost/Month | Commercial Rights | Automation |
|---|---|---|---|---|
| Mubert API | 25 tracks | $0 | ✅ Yes | ✅ Yes |
| Suno Pro | 500 songs | $8 | ✅ Yes | ✅ Yes (API) |
| YouTube Audio Library | Unlimited | $0 | ✅ Yes | ❌ Manual |
Recommendation: Start with Mubert API free tier (25 tracks covers 8-12 videos/month).
Next Steps¶
- ✅ ~~Explore Suno AI~~ (Completed Oct 31, 2025)
- ⬜ Sign up for Mubert API (https://mubert.com/api)
- ⬜ Get Mubert API key
- ⬜ Test music generation with Mubert
- ⬜ Create automation script
- ⬜ Post first video to X with AI-generated music
- ⬜ Document Mubert account details in credentials file
Related Documentation¶
- SOCIAL_MEDIA_TRACKER_CSV.md - Social media content tracking (CSV)
- YOUTUBE_MUSIC_GUIDE.md - Manual music selection for YouTube
- SOCIAL_MEDIA_CONTENT_TRACKER.md - Content publishing log
- X_POSTING_SCHEDULE.md - X (Twitter) posting schedule
Created: October 31, 2025 Next Review: After Mubert API signup and first automated video