Skip to content

Instantly share code, notes, and snippets.

@Ereza
Created December 17, 2016 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ereza/e48049822fd730157651181002b0cbe8 to your computer and use it in GitHub Desktop.
Save Ereza/e48049822fd730157651181002b0cbe8 to your computer and use it in GitHub Desktop.
Nightcorizer script (sox+ffmpeg)
#!/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