Skip to content

Instantly share code, notes, and snippets.

@martinratinaud
Created April 7, 2023 12:29
Show Gist options
  • Save martinratinaud/af25936fdf282456750aee0d93cc6cfb to your computer and use it in GitHub Desktop.
Save martinratinaud/af25936fdf282456750aee0d93cc6cfb to your computer and use it in GitHub Desktop.
Compress mp4 on mac using ffmpeg
video_compress() {
filename_without_extension="${input_file%.*}"
extension="${input_file##*.}"
output_file="${filename_without_extension}-compressed.${extension}"
ffmpeg -i "$input_file" -vcodec libx264 -crf 23 -acodec aac -strict -2 -movflags faststart "$output_file"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment