`acrossover’ and its visualization¶
Watch on youtube.comTo split audio stream into several bands, you can use `lowpass’, `bandpass’, `highpass’, etc., but in recent ffmpeg you can also use `acrossover’.
00:00:00Though it is unclear how to use it due to the lack of explanation of the official document, it seems to be used like this:
#! /bin/sh
ifn="Air on the G String (from Orchestral Suite no. 3, BWV 1068).mp3"
ifnb="`basename \"${ifn}\" .mp3`"
pref="`basename $0 .sh`"
#
"/c/Program Files/ffmpeg-4.1-win64-shared/bin/ffmpeg" -y \
-i "${ifn}" -filter_complex "
[0:a]acrossover=split='500 2000'[div1][div2][div3];
[div1]asplit[div1_1][div1_2];
[div2]asplit[div2_1][div2_2];
[div3]asplit[div3_1][div3_2];
[div1_2]showcqt=s=1920x1080[v1];
[div2_2]showcqt=s=1920x1080[v2];
[div3_2]showcqt=s=1920x1080[v3]" \
-map '[v1]' -map '[div1_1]' "${pref}_${ifnb}_1.mp4" \
-map '[v2]' -map '[div2_1]' "${pref}_${ifnb}_2.mp4" \
-map '[v3]' -map '[div3_1]' "${pref}_${ifnb}_3.mp4"
#! /bin/sh
pref="`basename $0 .sh`"
"/c/Program Files/ffmpeg-4.1-win64-shared/bin/ffmpeg" -y -filter_complex "
aevalsrc='-2+random(0)|-2+random(0)':d=30,asplit=3[as0][as1][as2];
[as0]acrossover=split='125 500 2000 8000'[a01][a02][a03][a04][a05];
[as1]acrossover=split='125 500 2000 8000'[a11][a12][a13][a14][a15];
[as2]volume=0.05[a];
[a01]showfreqs=s=320x216[v01];
[a02]showfreqs=s=320x216[v02];
[a03]showfreqs=s=320x216[v03];
[a04]showfreqs=s=320x216[v04];
[a05]showfreqs=s=320x216[v05];
[v01][v02][v03][v04][v05]vstack=5[vl];
[a11]showcqt=s=1600x216[v11];
[a12]showcqt=s=1600x216[v12];
[a13]showcqt=s=1600x216[v13];
[a14]showcqt=s=1600x216[v14];
[a15]showcqt=s=1600x216[v15];
[v11][v12][v13][v14][v15]vstack=5[vr];
[vl][vr]hstack[v]
" -map '[v]' -map '[a]' "${pref}.mp4"
#! /bin/sh
ifn="Air on the G String (from Orchestral Suite no. 3, BWV 1068).mp3"
ifnb="`basename \"${ifn}\" .mp3`"
pref="`basename $0 .sh`"
#
"/c/Program Files/ffmpeg-4.1-win64-shared/bin/ffmpeg" -y -i "${ifn}" \
-filter_complex "
[0:a]asplit=2[a][as1];
[as1]acrossover=split='125 500 2000 8000'[a01][a02][a03][a04][a05];
[a01]showvolume,scale=1920:216[v01];
[a02]showvolume,scale=1920:216[v02];
[a03]showvolume,scale=1920:216[v03];
[a04]showvolume,scale=1920:216[v04];
[a05]showvolume,scale=1920:216[v05];
[v01][v02][v03][v04][v05]vstack=5[v]
" -map '[v]' -map '[a]' "${pref}_${ifnb}.mp4"
#! /bin/sh
ifn="Air on the G String (from Orchestral Suite no. 3, BWV 1068).mp3"
ifnb="`basename \"${ifn}\" .mp3`"
pref="`basename $0 .sh`"
#
"/c/Program Files/ffmpeg-4.1-win64-shared/bin/ffmpeg" -y -i "${ifn}" \
-filter_complex "
[0:a]asplit=2[a][as1];
[as1]acrossover=split='125 500 2000 8000'[a01][a02][a03][a04][a05];
[a01]showcqt=s=1920x216[v01];
[a02]showcqt=s=1920x216[v02];
[a03]showcqt=s=1920x216[v03];
[a04]showcqt=s=1920x216[v04];
[a05]showcqt=s=1920x216[v05];
[v01][v02][v03][v04][v05]vstack=5[v]
" -map '[v]' -map '[a]' "${pref}_${ifnb}.mp4"
#! /bin/sh
ifn="Air on the G String (from Orchestral Suite no. 3, BWV 1068).mp3"
ifnb="`basename \"${ifn}\" .mp3`"
pref="`basename $0 .sh`"
#
"/c/Program Files/ffmpeg-4.1-win64-shared/bin/ffmpeg" -y -i "${ifn}" \
-filter_complex "
[0:a]asplit=2[a][as1];
[as1]acrossover=split='125 500 2000 8000'[a01][a02][a03][a04][a05];
[a01]showwaves=split_channels=1:s=1920x216[v01];
[a02]showwaves=split_channels=1:s=1920x216[v02];
[a03]showwaves=split_channels=1:s=1920x216[v03];
[a04]showwaves=split_channels=1:s=1920x216[v04];
[a05]showwaves=split_channels=1:s=1920x216[v05];
[v01][v02][v03][v04][v05]vstack=5[v]
" -map '[v]' -map '[a]' "${pref}_${ifnb}.mp4"
#! /bin/sh
ifn="Air on the G String (from Orchestral Suite no. 3, BWV 1068).mp3"
ifnb="`basename \"${ifn}\" .mp3`"
pref="`basename $0 .sh`"
#
"/c/Program Files/ffmpeg-4.1-win64-shared/bin/ffmpeg" -y -i "${ifn}" \
-filter_complex "
[0:a]asplit=2[a][as1];
[as1]acrossover=split='125 500 2000 8000'[a01][a02][a03][a04][a05];
[a01]showwaves=mode=point:split_channels=1:s=1920x1080[v01];
[a02]showwaves=mode=point:split_channels=1:s=1920x1080[v02];
[a03]showwaves=mode=point:split_channels=1:s=1920x1080[v03];
[a04]showwaves=mode=point:split_channels=1:s=1920x1080[v04];
[a05]showwaves=mode=point:split_channels=1:s=1920x1080[v05];
color=black:size=1920x1080,loop=-1,setsar=1[bg];
[bg][v01]overlay=shortest=1[v1];
[v1][v02]overlay[v2];
[v2][v03]overlay[v3];
[v3][v04]overlay[v4];
[v4][v05]overlay[v]
" -map '[v]' -map '[a]' "${pref}_${ifnb}.mp4"
#! /bin/sh
ifn="Air on the G String (from Orchestral Suite no. 3, BWV 1068).mp3"
ifnb="`basename \"${ifn}\" .mp3`"
pref="`basename $0 .sh`"
#
"/c/Program Files/ffmpeg-4.1-win64-shared/bin/ffmpeg" -y -i "${ifn}" \
-filter_complex "
[0:a]asplit=2[a][as1];
[as1]acrossover=split='125 500 2000 8000'[a01][a02][a03][a04][a05];
[a01]showwaves=mode=line:split_channels=1:s=1920x1080:colors=0x3030FF@0.8[v01];
[a02]showwaves=mode=line:split_channels=1:s=1920x1080:colors=0x5050FF@0.8[v02];
[a03]showwaves=mode=line:split_channels=1:s=1920x1080:colors=0x7070FF@0.8[v03];
[a04]showwaves=mode=line:split_channels=1:s=1920x1080:colors=0x9090FF@0.8[v04];
[a05]showwaves=mode=line:split_channels=1:s=1920x1080:colors=0xB0B0FF@0.8[v05];
color=black:size=1920x1080,loop=-1,setsar=1[bg];
[bg][v01]overlay=shortest=1[v1];
[v1][v02]overlay[v2];
[v2][v03]overlay[v3];
[v3][v04]overlay[v4];
[v4][v05]overlay[v]
" -map '[v]' -map '[a]' "${pref}_${ifnb}.mp4"
#! /bin/sh
ifn="Air on the G String (from Orchestral Suite no. 3, BWV 1068).mp3"
ifnb="`basename \"${ifn}\" .mp3`"
pref="`basename $0 .sh`"
#
"/c/Program Files/ffmpeg-4.1-win64-shared/bin/ffmpeg" -y -i "${ifn}" \
-filter_complex "
[0:a]asplit=2[a][as1];
[as1]acrossover=split='125 500 2000 8000'[a01][a02][a03][a04][a05];
[a01]showwaves=mode=line:s=1500x900:split_channels=1:colors=0x3030FF@0.9[v01];
[a02]showwaves=mode=line:s=1500x900:split_channels=1:colors=0x5050FF@0.9[v02];
[a03]showwaves=mode=line:s=1500x900:split_channels=1:colors=0x7070FF@0.9[v03];
[a04]showwaves=mode=line:s=1500x900:split_channels=1:colors=0x9090FF@0.9[v04];
[a05]showwaves=mode=line:s=1500x900:split_channels=1:colors=0xB0B0FF@0.9[v05];
color=black:size=1920x1080,loop=-1,setsar=1[bg];
[bg][v01]overlay=x=60:y=0:shortest=1[v1];
[v1][v02]overlay=x=120:y=70[v2];
[v2][v03]overlay=x=180:y=140[v3];
[v3][v04]overlay=x=240:y=210[v4];
[v4][v05]overlay=x=300:y=280[v]
" -map '[v]' -map '[a]' "${pref}_${ifnb}.mp4"