Simple remix or mashup by reducing the volume

user1272047user1272047
2 min read

To overlap the last 10 seconds of dream.v.0.9.r.9.mp3 with the first 10 seconds of dream.v.1.5.r.9.a.mp3, you can use the following ffmpeg script:

# Go to the directory
cd /media/backup_005_3/music.mp3.etc.no.video.ws/music.mp3.etc/dream/remix.meshap.01

# Step 1: Extract the main portion of file1 (excluding the last 10 seconds)
ffmpeg -i dream.v.0.9.r.9.mp3 -t $(ffmpeg -i dream.v.0.9.r.9.mp3 2>&1 | grep Duration | cut -d ' ' -f 4 | sed s/,// | awk -F: '{ print ($1 * 3600) + ($2 * 60) + $3 - 10 }') -y dream.v.0.9.r.9.main.mp3

# Step 2: Extract the last 10 seconds of file1 with a fade-out effect
ffmpeg -sseof -10 -i dream.v.0.9.r.9.mp3 -af "afade=t=out:st=0:d=10" -y dream.v.0.9.r.9.last10sec.fadeout.mp3

# Step 3: Extract the first 10 seconds of file2 with a fade-in effect
ffmpeg -t 10 -i dream.v.1.5.r.9.a.mp3 -af "afade=t=in:ss=0:d=10" -y dream.v.1.5.r.9.a.first10sec.fadein.mp3

# Step 4: Concatenate file1 main part, overlap last 10 seconds of file1 with first 10 seconds of file2, then rest of file2
ffmpeg -i dream.v.0.9.r.9.main.mp3 -i dream.v.0.9.r.9.last10sec.fadeout.mp3 -i dream.v.1.5.r.9.a.first10sec.fadein.mp3 -i dream.v.1.5.r.9.a.mp3 \
-filter_complex "[1:a][2:a]amix=inputs=2:duration=shortest[aoverlap];[0:a][aoverlap][3:a]concat=n=3:v=0:a=1" -y remix_output.mp3

Explanation:

This should create a smooth overlap and output a seamless remix_output.mp3.

0
Subscribe to my newsletter

Read articles from user1272047 directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

user1272047
user1272047