#!/bin/sh
# source: https://github.com/Drakirus/dotfiles/blob/master/bin/2gif
$(ffmpeg --help 2> /dev/null > /dev/null)
if [[ $? -ne 0 ]]; then
echo "ffmpeg is required!"
exit 1
fi
# default values
FPS=12
# read the options
TEMP=`getopt -o c:r:f:t:s:d:hl:: --long resolution:,fps:,start:,to:,duration:,help,loop:: -n $0 -- "$@"`
eval set -- "$TEMP"
# extract options and their arguments into variables.
while true ; do
case "$1" in
-h|--help)
echo -e "Usage: $0 [options]