#!/bin/bash font_family="FiraCode-Regular.ttf" image="logo.jpg" getMetaTitle (){ tmp=$( ffprobe "$1" 2>&1 | grep title) echo ${tmp##*:} } for file in *.mp3; do title=$(getMetaTitle "$file") filename=${file%%.*} ffmpeg -y -i "$file" -i "$image" -filter_complex \ "[1:v]scale=w=320:h=320,pad=1280:720:(ow-iw)/2:oh/2-ih[image]; \ [0:a]showwaves=s=1280x200:mode=cline:colors=#2A384E[sw]; \ [image][sw]overlay=0:H-h,drawtext=text=${title}:fontcolor=white:fontsize=36:x=(W-tw)/2:y=H/2+th:fix_bounds=true:fontfile=$font_family[out]" \ -map "[out]" -map 0:a -c:v libx264 -preset fast -crf 18 -c:a copy "${filename}.mkv" done