Skip to content

Instantly share code, notes, and snippets.

@jhburns
Last active February 24, 2020 02:37
Show Gist options
  • Save jhburns/ade6c893d933924f2ed5c5d868c8469c to your computer and use it in GitHub Desktop.
Save jhburns/ade6c893d933924f2ed5c5d868c8469c to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
while read -rep "Enter input path location: " in_dir; do
if [ -d "${in_dir}" ]; then
echo "${in_dir} already exists - please enter a valid directory path."
else
break
fi
done
eval cd "$in_dir"
while read -rep "Enter output path location: " out_dir; do
if [ -d "${out_dir}" ]; then
echo "${out_dir} already exists - please enter a valid directory path."
else
break
fi
done
videos=( $(find . -name "*.MOV" -print | sort) )
for video in "${videos[@]}"
do
mkdir -p "${out_dir}/${video##*/}"
done
printf '%s\n' "${videos[@]}" | parallel -j 8 "ffmpeg -i {} -qscale:v 5 -vsync 0 -hide_banner -loglevel panic ${out_dir}/{/}/%d.jpg && echo {} done "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment