Skip to content

Instantly share code, notes, and snippets.

@thenumbernine
Created October 13, 2025 14:08
Show Gist options
  • Select an option

  • Save thenumbernine/129d2f9418d0ecf59192e8d24c631508 to your computer and use it in GitHub Desktop.

Select an option

Save thenumbernine/129d2f9418d0ecf59192e8d24c631508 to your computer and use it in GitHub Desktop.
bash script for ffmpeg reencoding to save size
#!/usr/bin/env sh
CRF="${2:-30}"
ffmpeg -i "$1" -c:v libx264 -preset slow -crf $CRF -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" -c:a copy "${1%.*}_reenc.mp4"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment