Skip to content

Instantly share code, notes, and snippets.

@icaoberg
Last active October 13, 2022 15:12
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 icaoberg/45fccb9b03fc7e085151 to your computer and use it in GitHub Desktop.
Save icaoberg/45fccb9b03fc7e085151 to your computer and use it in GitHub Desktop.
Extracts images from movie #macosx #ffmpeg
#this script extracts frames for all movies (.mov) in the current folder.
# one image per frame per second saved to disk
for MOVIE in *.mov
do
if [ -f "$MOVIE" ]; then
FILENAME="${MOVIE%.*}"
echo $FILENAME
if [ ! -d "$FILENAME" ]; then
mkdir "$FILENAME"
fi
cd "$FILENAME"
#modify fps if you want to extract more than one frame per second
ffmpeg -i ../$MOVIE -vf fps=1 $FILENAME"_"%05d.png
cd ..
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment