Created
December 17, 2016 15:24
-
-
Save Ereza/e48049822fd730157651181002b0cbe8 to your computer and use it in GitHub Desktop.
Nightcorizer script (sox+ffmpeg)
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 | |
if [ $# -ne 6 ] | |
then | |
echo "Usage: $0 input_audio background_image text_to_display speed spectrum_color output_video" | |
echo "Example: $0 \"My song.mp3\" \"My background image.jpg\" \"Artist - Song\" 1.27 FFFFFF \"Output video.mp4\"" | |
exit 1 | |
fi | |
ffmpeg -i "$1" _temp.wav | |
sox _temp.wav _temp_speedup.wav speed $4 | |
rm _temp.wav | |
echo "$3" > _temp.txt | |
ffmpeg -i _temp_speedup.wav -i "$2" -filter_complex \ | |
"[0:a]showwaves=s=1920x200:mode=line:colors=$5,format=rgba,colorkey=black[fg]; \ | |
[1:v][fg]overlay=0:850,format=yuv420p,drawtext=font=Agenda:fontsize=80:fontcolor=white:x=10:y=1000:borderw=2:textfile='_temp.txt'[out]" \ | |
-map "[out]" -map 0:a -c:v libx264 -preset fast -crf 18 -c:a aac "$6" | |
rm _temp_speedup.wav | |
rm _temp.txt | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment