-
-
Save Bioblaze/2ea9aff3cf18826b3eba9ccea9af6cd3 to your computer and use it in GitHub Desktop.
Script to generate an mp4 video file from still images
This file contains hidden or 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 animaition 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 -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