Skip to content

Instantly share code, notes, and snippets.

@geraldurbas
Created September 29, 2023 01:07
Show Gist options
  • Save geraldurbas/5285c6007fc0e6a35f2491ce9098037d to your computer and use it in GitHub Desktop.
Save geraldurbas/5285c6007fc0e6a35f2491ce9098037d to your computer and use it in GitHub Desktop.
AVI & Mp4 Slideshow with ffmpeg for Hunter Camera Images
for i in $(find /somepath -type f -name "DSCF0001.JPG")
do
path="${i//DSCF0001.JPG/}"
cd $path
if [ ! -f "outputFinal.avi" ]; then
su - www-data -s /bin/bash -c "cd $path; ffmpeg -f image2 -framerate 3 -pattern_type glob -i '*.JPG' -s 3072x1728 outputFinal.avi"
fi
if [ ! -f "outputFinal.mp4" ]; then
su - www-data -s /bin/bash -c "cd $path; ffmpeg -f image2 -framerate 3 -pattern_type glob -i '*.JPG' -s 3072x1728 outputFinal.mp4"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment