Skip to content

Instantly share code, notes, and snippets.

@wiledal
Last active February 10, 2023 08:31
Show Gist options
  • Save wiledal/395eaf3e16db0b506005d199621046e6 to your computer and use it in GitHub Desktop.
Save wiledal/395eaf3e16db0b506005d199621046e6 to your computer and use it in GitHub Desktop.
OSX Automator FFMPEG scripts
# Convert a video file to 720p with 24fps
/opt/homebrew/bin/ffmpeg -i "$@" -preset slow -codec:a aac -b:a 128k -codec:v libx264 -pix_fmt yuv420p -b:v 2500k -minrate 1500k -maxrate 4000k -bufsize 5000k -vf scale=-1:720 -filter:v fps=24 "$@-converted.mp4"
# Simpler
/opt/homebrew/bin/ffmpeg -y -i "$@" -preset slow -codec:a aac -b:a 128k -codec:v libx264 -pix_fmt yuv420p -b:v 2500k -filter:v "scale=-2:720, fps=48" "$@-converted.mp4"
# Convert audio to .mp3
/opt/homebrew/bin/ffmpeg -y -i "$@" -vn -ar 44100 -ac 2 -b:a 192k "$@.mp3"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment