`showcqt’, `showwaves’ and `showvolume’ (overlay)¶
Watch on youtube.com- doc
https://ffmpeg.org/ffmpeg-filters.html#showcqt, https://ffmpeg.org/ffmpeg-filters.html#showwaves, https://ffmpeg.org/ffmpeg-filters.html#showwvolume, https://ffmpeg.org/ffmpeg-filters.html#overlay, https://ffmpeg.org/ffmpeg-filters.html#colorkey
#! /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]showcqt=s=1920x1080[vcqt];
[0:a]showvolume=p=1,scale=1280:40[vv];
[0:a]showwaves=split_channels=1:mode=line:s=1280x480[vs];
[vs][vv]overlay=x=0:y=(H-h)/2[v1];
[vcqt][v1]overlay=x=W-w-50:y=50[v]
" -map '[v]' -map '0:a' -c:a copy \
"${pref}_${ifnb}.mp4"
## option p of showvolume can not be used in old ffmpeg.
#ffmpeg -y \
#-i "${ifn}" -filter_complex "
#[0:a]showcqt=s=1920x1080[vcqt];
#[0:a]showvolume,scale=1280:40[vv];
#[0:a]showwaves=split_channels=1:mode=line:s=1280x480[vs];
#[vs][vv]overlay=x=0:y=(H-h)/2[v1];
#[vcqt][v1]overlay=x=W-w-50:y=50[v]
#" -map '[v]' -map '0:a' -c:a copy \
# "${pref}_${ifnb}.mp4"
If you are concerned about the insufficient transparency of “showvolume”, you can combine it with “colorkey”:
#! /bin/sh
ifn="Air on the G String (from Orchestral Suite no. 3, BWV 1068).mp3"
ifnb="`basename \"${ifn}\" .mp3`"
pref="`basename $0 .sh`"
#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:a]showcqt=s=1920x1080[vcqt];
[0:a]showvolume,colorkey=black,scale=1280:40[vv];
[0:a]showwaves=split_channels=1:mode=line:s=1280x480[vs];
[vs][vv]overlay=x=0:y=(H-h)/2[v1];
[vcqt][v1]overlay=x=W-w-50:y=50[v]
" -map '[v]' -map '0:a' -c:a copy \
"${pref}_${ifnb}.mp4"