Skip to content

Instantly share code, notes, and snippets.

@krabello
Created May 19, 2017 18:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krabello/7f928aef8e3026550118e4da4b8a3775 to your computer and use it in GitHub Desktop.
Save krabello/7f928aef8e3026550118e4da4b8a3775 to your computer and use it in GitHub Desktop.
Converts a Audio file and image to video. In order to be used on youtube
#!/bin/sh
# example line
# 372|"Baby Beluga CD"|Raffi8054BabyBeluga.mp3|http://www.domain.com/img/data/ETA_CD56.jpg
while IFS='|' read field1 field2 field3 field4 || [[ -n "$line" ]]; do
f=$(echo $field2 | tr -d '"' | tr -d ' ' | tr -d '®' | tr -d "'" | tr -d '‘' | tr -d '’' | tr -d '&' | tr -d ',' | tr -d '-')
ffmpeg -loop 1 -i $field4 -i $field3 -c:v libx264 -c:a aac -strict experimental -b:a 192k -shortest ./out/$f.mp4 < /dev/null
done < "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment