-
-
Save shelldandy/309bbf95092a8ed4627b42b0949b13b7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment