#!/bin/bash set -e DIR="$( cd "$( dirname "$(realpath "${BASH_SOURCE[0]}")" )" &> /dev/null && pwd )" PROGNAME="$0" . "$DIR/../include/bash/include.bash" input= output= command= ffmpeg_args="-nostats -loglevel error" config_dir=$HOME/.config/video-util config_dir_set= usage() { cat <&2 echo "using ${BOLD}$config_dir${RST} as config directory" fi [ -z "$command" ] && die "command not specified" case "$command" in snapshot) check_input_file [ -z "$output" ] && { echowarn "--output not specified, using snapshot.jpg as default" output="snapshot.jpg" } ffmpeg $ffmpeg_args -i "$input" -frames:v 1 -q:v 2 "$output"