Skip to content

Instantly share code, notes, and snippets.

@davedarko
Created February 17, 2020 10:48
Show Gist options
  • Save davedarko/956772590b413734c38af7f55b3eaa04 to your computer and use it in GitHub Desktop.
Save davedarko/956772590b413734c38af7f55b3eaa04 to your computer and use it in GitHub Desktop.
Countdown Video Generator for Mate Light
#!/bin/sh
#This example will create a 15min video, with 10 frames per second
fps=10;
seconds=900;
mantissaDigits=2;
upperFont=14;
#upperFont=53;
lowerFont=100;
ffmpeg -loop 1 -i ~/Pictures/black-background.png -c:v libx264 -r $fps -t $seconds -pix_fmt rgb24 -vf "fps=$fps,drawtext=fontfile='/usr/share/fonts/truetype/freefont/FreeMono.ttf':fontcolor=white:fontsize=$upperFont:x=(w-text_w)/2:y=(h-text_h)/2:text='%{eif\:(($seconds-t)/60)\:d}\:%{eif\:(mod($seconds-t, 60))\:\d\:2 }'" "$seconds seconds countdown timer.mp4";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment