# This is a simplified script of https://gist.github.com/keunwoochoi/f0ea2c49355fc21e93dad88d210efcdd # Usage: 1. Modify the font path in the line with [ss]. # In my case, I copied and pasted CircularSpAraTTBlack.ttf to the same folder. # 2. Put the wav file in the same folder, say, audio_file.wav # 3. run $./spectrogram_scrolling_video.sh audio_file.wav # 4. You'll see audio_file.mkv in the same folder! # # Based on example here https://trac.ffmpeg.org/wiki/Encode/YouTube text=$(basename $1 .wav) ffmpeg -i $1 -filter_complex \ "[0:a]showspectrum=mode=combined:color=intensity:scale=log:s=1280x720,pad=1280:720[ss]; \ [ss]drawtext=fontfile=CircularSpAraTTBlack.ttf:fontcolor=white:x=10:y=10:text=$text[out]" \ -map "[out]" -map 0:a -c:v libx264 -preset fast -crf 18 -c:a copy $text.mkv