Skip to content

Instantly share code, notes, and snippets.

@xverges
Created September 12, 2021 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xverges/ea20ce0ac7cb0ee8b64d0216c67572c6 to your computer and use it in GitHub Desktop.
Save xverges/ea20ce0ac7cb0ee8b64d0216c67572c6 to your computer and use it in GitHub Desktop.
#!/bin/zsh
set -euo pipefail
me=$(basename "$0")
if [ $# -ne 2 ]; then
echo "USAGE: ${me} <input> <speed_increment>"
# TODO: print usage
exit 1
fi
filename="${1%.*}"
extension="${1##*.}"
output=${filename}.$2.${extension}
ffmpeg -i $1 -vf "setpts=(PTS-STARTPTS)/$2" -crf 18 -af atempo=$2 ${output}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment