Skip to content

Instantly share code, notes, and snippets.

@luruke
Created March 3, 2014 13:56
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 luruke/80772bfe76b66268c5e9 to your computer and use it in GitHub Desktop.
Save luruke/80772bfe76b66268c5e9 to your computer and use it in GitHub Desktop.
Generate Blur Videos with ffmpeg
#!/bin/bash
if [ $1 = "webm" ]; then
for i in videos/webm/*.webm; do
if [ -e "$i" ]; then
file=`basename "$i" .webm`
ffmpeg -i "$i" -b:v 500k -qmin 10 -qmax 42 -maxrate 500k -bufsize 1000k -threads 4 -an -vf "smartblur=lr=5" -y "videos/webm/blur/$file.webm"
fi
done
elif [ $1 = "mp4" ]; then
for i in videos/mp4/*.mp4; do
if [ -e "$i" ]; then
file=`basename "$i" .mp4`
ffmpeg -i "$i" -an -vf "smartblur=lr=5" -y "videos/mp4/blur/$file.mp4"
fi
done
else
echo "pass mp4/webm"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment