Skip to content

Instantly share code, notes, and snippets.

@machiq
Last active July 12, 2019 17:00
Show Gist options
  • Save machiq/ab0993420a582c2212b204ebb2ac519e to your computer and use it in GitHub Desktop.
Save machiq/ab0993420a582c2212b204ebb2ac519e to your computer and use it in GitHub Desktop.
Convert Movie Files into PNG Sequence
#!/bin/bash
#
# 2019-07-12 - Matt Crnich - v001 - Turn Movies into PNG Sequence
#
echo "ENTER SEARCH PATH : "
read srcFilePath
echo
echo "ENTER SEARCH EXTENSION : "
read fileExt
echo
for input in `find "$srcFilePath" -name "*.$fileExt" -print0 | xargs -0`;
do fullPath="$srcFilePath/${input##*/}";
#echo "fullPath = "$fullpath;
#
# Make New Directory matching name of input file
#
mkdir -p ${fullPath%.*};
#
assetName=${fullPath##*/} assetName=${assetName%.*};
# echo "assetName = "$assetName;
#
pathPref=${fullPath%/*};
# echo "pathPref = "$pathPref;
#
output="${pathPref}/${assetName}/${assetName}.%04d.png";
# echo "output = "$output;
#
ffmpeg -i "$input" -vf scale=1920:-1:flags=bilinear "$output";
done
echo
echo "CONVERSION COMPLETE"
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment