Skip to content

Instantly share code, notes, and snippets.

@hvrauhal
Created September 21, 2016 07:24
Show Gist options
  • Save hvrauhal/b2203f45ab9bec664e60318472d83b63 to your computer and use it in GitHub Desktop.
Save hvrauhal/b2203f45ab9bec664e60318472d83b63 to your computer and use it in GitHub Desktop.
#!/bin/zsh
# brew install ffmpeg
set -e
FILENAME=$1
echo "Recompressing $FILENAME"
VIDEO_BITRATE=512k
ffmpeg -i ${FILENAME} -codec:a copy -y -c:v libx264 -preset veryslow -b:v ${VIDEO_BITRATE} -pass 1 -f mp4 /dev/null && \
ffmpeg -i ${FILENAME} -codec:a copy -c:v libx264 -preset veryslow -b:v ${VIDEO_BITRATE} -pass 2 ${FILENAME}_compressed.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment