Skip to content

Instantly share code, notes, and snippets.

@jtebert
Created October 25, 2017 13:13
Show Gist options
  • Save jtebert/9b70861dbfe1ef07e1ea369a3dffd599 to your computer and use it in GitHub Desktop.
Save jtebert/9b70861dbfe1ef07e1ea369a3dffd599 to your computer and use it in GitHub Desktop.
A simple video compression script using ffmpeg (similar to resizer.sh)
#!/bin/bash
# A simple video compression script using ffmpeg (similar to resizer.sh)
# INPUTS: input_files width output/path
# EXAMPLE: compressor "videos/*.mp4" 1280 "videos/compressed"
mkdir -p $3
for i in $1;
do
path=${i%.*}
name=${path##*/}
ffmpeg -i "$i" -vcodec h264 -vf scale=$2:-1 -an $3/$name.mp4;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment