-
-
Save luruke/80772bfe76b66268c5e9 to your computer and use it in GitHub Desktop.
Generate Blur Videos with ffmpeg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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