Last active
May 31, 2021 18:46
-
-
Save tkarna/c5bba20628d66385a76a1ef960613033 to your computer and use it in GitHub Desktop.
Script to generate an mp4 video file from still images
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
#!/bin/bash | |
# generate mp4 animation from still images with ffmpeg. | |
if [ $# != 2 ]; then | |
echo "Usage: $(basename "$0") \"image/file/pattern_*.png\" output.mp4" | |
exit -1 | |
fi | |
pattern=$1 | |
outputfile=$2 | |
ffmpeg -y -r 25 -pattern_type glob -i "$pattern" \ | |
-r 25 -c:v libx264 -preset slow -crf 5 \ | |
-vf "scale=ceil(iw/3)*2:ceil(ih/3)*2" \ | |
-pix_fmt yuv420p \ | |
$outputfile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment