Skip to content

Instantly share code, notes, and snippets.

@eruizdechavez eruizdechavez/ Secret
Last active Oct 16, 2019

What would you like to do?
# For each mp3 file in the folder...
for file in $(ls *.mp3); do
#... extract ID3 tags into a text file...
ffmpeg -y -i $file -f ffmetadata ${file}.txt
#... extract the episode title into a text file...
cat ${file}.txt | grep title | awk -F "=" 'NR==1{print $2}' > ${file}.title.txt
# ... and mix the logo, audio, and the title into a single video file
ffmpeg -y -i $file -i logo.jpg -filter_complex \
"[1:v]scale=w=320:h=320,pad=1280:720:(ow-iw)/2:oh/2-ih[logo]; \
[0:a]showwaves=s=1280x200:mode=cline:colors=#2A384E[sw]; \
[logo][sw]overlay=0:H-h,drawtext=textfile=${file}.title.txt:fontcolor=white:fontsize=36:x=(W-tw)/2:y=H/2+th:fix_bounds=true:fontfile=/Users/erick.ruizdechavez/Library/Fonts/FiraCode-Regular.ttf[out]" \
-map "[out]" -map 0:a -c:v libx264 -preset fast -crf 18 -c:a copy ${file}.mkv

This comment has been minimized.

Copy link

lesthack commented Oct 16, 2019

Nice !

Agregué una función para evitar crear archivos de texto.

Saludos !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.