Skip to content

Instantly share code, notes, and snippets.

@ArmanTaheriGhaleTaki
Created July 29, 2022 04:03
Show Gist options
  • Save ArmanTaheriGhaleTaki/e2cf84743df55cab3a441af4836ef914 to your computer and use it in GitHub Desktop.
Save ArmanTaheriGhaleTaki/e2cf84743df55cab3a441af4836ef914 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