dotfiles/.local/bin/ffreduce

21 lines
463 B
Bash
Executable File

#!/bin/bash -e
if [ -z "$1" ] || [ -z "$2" ]; then
echo "USAGE: $(basename "${BASH_SOURCE[0]}") in out [smallside]" >&2
exit 1
fi
in="$1"; shift
out="$1"; shift
smallside="${1:-720}"; shift || true
if ! [ -r "$in" ]; then
echo "error: can't read '$in'" >&2
exit 1
fi
set -x
#ffmpeg -i "$in" -r 24 -vcodec libx265 -vf "scale=-2:$smallside,setpts=0.5*PTS" "$@" "$out"
ffmpeg -i "$in" -r 24 -vcodec libx265 -vf "scale=-2:$smallside" "$@" "$out"