#!/usr/bin/env bash set -euo pipefail # Defaults q={{ reencode_quality }} cpu={{ reencode_cpu }} time_limit="" print_only=false limit_resolution={{ res_y }} limit_fps={{ fps }} while getopts :q:c:t:s OPT; do case $OPT in q|+q) q="$OPTARG" ;; c|+c) cpu="$OPTARG" ;; t|+t) time_limit="-to $OPTARG" ;; s) print_only=true ;; *) echo "usage: `basename $0` [+-q ARG] [+-c ARG} [--] ARGS..." exit 2 esac done shift `expr $OPTIND - 1` OPTIND=1 input="$1" output="${2:-$(echo $input | sed 's/--original.*/--reencoded.webm/')}" command="$(cat<