Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Batch convert video files to frames
#!/bin/bash
# Batch convert video files to frames
# script by Harrison Lingren
for file in Video/*;
do
echo "> Parsing file: $file";
if [ ! -d "${file:6:4}" ]; then
echo "> Creating directory ${file:6:4}...";
mkdir "./${file:6:4}";
fi
echo "> Saving to: ${file:6:4}/%04d.jpg";
ffmpeg -i "$file" -r 3 ${file:6:4}/%04d.jpg;
done
@harrisonlingren
Copy link
Author

harrisonlingren commented Dec 4, 2017

Requires ffmpeg to run. Save your video files in a Videos/ directory next to the script. Output will be split to directories using the first 4 characters of the video name as directory names.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment