Skip to content

Instantly share code, notes, and snippets.

@eruizdechavez
Last active April 5, 2020 13:57
Show Gist options
  • Save eruizdechavez/c4cbc596b92adb7a463ecefc78d9f878 to your computer and use it in GitHub Desktop.
Save eruizdechavez/c4cbc596b92adb7a463ecefc78d9f878 to your computer and use it in GitHub Desktop.
#!/bin/bash
# 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
done
@shelldandy
Copy link

no lo pongas secreto prrin smhhhhhhhhhhhhhhhhhhhhh

@lesthack
Copy link

Antes estaba publico, que paso ?

@eruizdechavez
Copy link
Author

Siempre ha estado privado, pero el link esta en las notas de DevNights.

@lesthack
Copy link

BTW, @eruizdechavez no te jaló mi fork en archivos con caps ?

@eruizdechavez
Copy link
Author

Nope, pero tampoco le dedique tiempo a revisar que fallaba. De cualquier forma estoy pensando en dejar de meter los capítulos en el audio 🤷🏻‍♂️.

@lesthack
Copy link

Si quieres mi muy humilde opinión, yo si valoro esos datos dentro del archivo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment