Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save miladj3/fde2ec87e02acdb167646a04d96ce0c5 to your computer and use it in GitHub Desktop.
Save miladj3/fde2ec87e02acdb167646a04d96ce0c5 to your computer and use it in GitHub Desktop.
this is a bash script that compress MP4 formatted videos in a folder automatically and name the output as [Videoname] _compressed.mp4
#!/bin/bash
VIDEOS=$(ls *.mp4)
for VIDEO in $VIDEOS
do
ffmpeg -i $VIDEO -vcodec libx265 -crf 28 -f mp4 ${VIDEO%%.*}_compressed.mp4
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment