Skip to content

Instantly share code, notes, and snippets.

@tangert
Last active July 8, 2021 14:39
Show Gist options
  • Save tangert/65c16cd320a13ab45e1870bb0ffcc8b5 to your computer and use it in GitHub Desktop.
Save tangert/65c16cd320a13ab45e1870bb0ffcc8b5 to your computer and use it in GitHub Desktop.
Just makes videos smol. sensible defaults for ffmpeg
# USAGE:
# smolvid yourmovie.mov
# INSTALL:
# add this to your .bashrc or .zshrc or wherever:
# alias smolvid="bash path/to/smolvid.sh "$1""
# SCRIPT:
# input file
INPUT="$1"
# auto create a new output file name
FILE_NAME=$(echo "$INPUT" | cut -f 1 -d '.')
EXTENSION=$(echo "$INPUT" | cut -f 2 -d '.')
OUTPUT="${FILE_NAME}-new.${EXTENSION}"
# run it through ffmpeg
ffmpeg -i "$INPUT" -vcodec libx264 -c:a copy -crf 30 "$OUTPUT"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment