Skip to content

Instantly share code, notes, and snippets.

@sposmen
Created November 25, 2019 20:48
Show Gist options
  • Save sposmen/114d2cde7f7dd750a8467e00487d3b32 to your computer and use it in GitHub Desktop.
Save sposmen/114d2cde7f7dd750a8467e00487d3b32 to your computer and use it in GitHub Desktop.
This small script is to memoize a fast convertion of ffmpeg
#!/usr/bin/env bash
for i in *.MP4;
do name=`echo $i | cut -d'.' -f1`;
FILE="small/${name}_small.MP4"
if [ -f "$FILE" ]; then
echo "$FILE exist"
else
echo "$FILE does not exist. Creating..."
ffmpeg -i "$i" "${FILE}";
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment