Last active
December 2, 2022 11:09
-
-
Save rieder/817a437bdbba7dacee2b50f0230a7f55 to your computer and use it in GitHub Desktop.
Make a movie from a set of PNG images, using ffmpeg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
framerate=60 | |
i=0 | |
padtowidth=6 | |
for plot in plot-??????.png; do | |
ln -s $plot `printf "frame-%0*d.png \n" $padtowidth $i`; | |
let i=i+1 | |
done | |
ffmpeg -framerate $framerate \ | |
-i frame-%06d.png \ | |
-c:v libx264 \ | |
-r $framerate \ | |
-pix_fmt yuv420p \ | |
-vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" \ | |
movie.mp4 | |
rm frame-*.png |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment