Skip to content

Instantly share code, notes, and snippets.

@amoilanen
Created October 14, 2023 19:03
Show Gist options
  • Save amoilanen/0b1dbd4a6b98751e36c2aa726e716ace to your computer and use it in GitHub Desktop.
Save amoilanen/0b1dbd4a6b98751e36c2aa726e716ace to your computer and use it in GitHub Desktop.
.bashrc fragment with utility commands to compress videos
#!/bin/bash
compress_videos() {
for f in "$@"; do compress_video $f; done;
}
compress_video() {
fullname=$1
extension="${fullname##*.}"
name_without_extension="${fullname%.*}"
ffmpeg -i $fullname -vcodec libx265 -crf 28 $name_without_extension.compressed.$extension
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment