Created
October 27, 2017 08:09
-
-
Save songpon/bd88b3eec5c346df5ef9e79b41349007 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 | |
image_name=$(od -A n -t d -N 1 /dev/urandom) | |
#Replace unused string in caption ( extension dot) | |
caption=$(echo $1 | sed -r 's/_/ /g;s/\./ /g; s/mp3//gI; s/m4a//gI') | |
convert -background black -size 800x480 -fill "#ff0080" -pointsize 72 -gravity center caption:"$caption" $image_name.png | |
ffmpeg -loop 1 -r ntsc -i $image_name.png -i "$1" -c:a copy -c:v libx264 -preset fast -threads 0 -shortest "$1".mkv | |
# convert m4a to mp3 | |
#find . -type f -name '*.m4a' -exec bash -c 'avconv -i "$0" "${0/%m4a/mp3}"' '{}' \; | |
# rename | |
# for f in *; do mv "$f" "`echo $f | sed s/.mix_MP3WRAP//`"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment