Skip to content

Instantly share code, notes, and snippets.

@virtuosonic
Created May 29, 2025 18:04
Show Gist options
  • Save virtuosonic/de3738762b3c43a9881aed34d76497e2 to your computer and use it in GitHub Desktop.
Save virtuosonic/de3738762b3c43a9881aed34d76497e2 to your computer and use it in GitHub Desktop.
compress video with ffmpeg h265
#!/bin/sh
# check $1 and $2
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: $0 <input_file> <output_file>"
exit 1
fi
# check if $1 is a file
if [ ! -f "$1" ]; then
echo "Error: $1 is not a file"
exit 1
fi
ffmpeg -i $1 -vcodec libx265 -crf 18 -tag:v hvc1 -preset veryslow $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment