Skip to content

Instantly share code, notes, and snippets.

@brunosan
Created February 18, 2024 01:30
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 brunosan/8b4179079ec97d98861e85fd57a0a38d to your computer and use it in GitHub Desktop.
Save brunosan/8b4179079ec97d98861e85fd57a0a38d to your computer and use it in GitHub Desktop.
Create a properly ordered animated video from frames
#/bin/bash
rm -rf a_temp_images
mkdir -p a_temp_images
i=1
for f in $(ls Images_*.png | sort -V ); do
ln -s "$PWD/$f" "a_temp_images/$(printf "%05d.png" $i)"
i=$((i + 1))
done
ffmpeg -y -f image2 -framerate 25 -i a_temp_images/%05d.png -vcodec libx264 -preset slower -crf 25 Animation.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment