Skip to content

Instantly share code, notes, and snippets.

@redeemedfadi
Last active January 18, 2017 09:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save redeemedfadi/d1cbbad63abe102c4db7 to your computer and use it in GitHub Desktop.
Save redeemedfadi/d1cbbad63abe102c4db7 to your computer and use it in GitHub Desktop.
for f in $@
do
echo "Compressing: $f"
mdate=$(GetFileInfo -m "$f")
avconvert --preset PresetAppleM4V1080pHD -s $f -o "compressed_$f"
SetFile -m "$mdate" -d "$mdate" "compressed_$f"
# Uncomment the following line to overwrite original file with new compressed version
# mv "compressed_$f" "$f"
done
@redeemedfadi
Copy link
Author

Do you use a Canon DSLR to take 1080p video and use OS X?

The size of the produced video files are huge (around 350MB/min)!

Run this script to compress all those videos up to 4.5x smaller in size without any visible quality loss!
For example, a video of length 8:27 is 2.98GB. After compression the file is 655MB!

Requires OSX

bash compress-mov.sh *.MOV

Also requires Xcode in order to preserve created/modified dates.
If you don't want to install Xcode, comment out lines 4 and 6. However, your videos will be dated today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment