Created
August 28, 2013 23:22
-
-
Save benbjohnson/6372609 to your computer and use it in GitHub Desktop.
Generate a video of frame numbers.
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 the frames | |
for i in {0..1800} | |
do | |
echo "Generating frame $i" | |
convert -background black -fill white -size 480x320 -pointsize 48 -gravity center label:${i} frame${i}.png | |
done | |
# Combine frames into H.264 MP4 video. (29.97fps & 30fps) | |
ffmpeg -i frame%d.png -t 60.06 -codec:v libx264 -r 30000/1001 29_97fps.mp4 | |
ffmpeg -i frame%d.png -t 60 -codec:v libx264 -r 30 30fps.mp4 | |
# Clean up frames. | |
rm frame*.png |
ffmpeg -r 30 -i frame%d.png -c:v libx264 -pix_fmt yuv420p ~/720p_30fps.mp4
This works for me.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for this.
Per this post, the default pixel format isn't compatible with QuickTime. Appending a pixel format worked for me:
ffmpeg -i frame%d.png -t 60 -codec:v libx264 -r 30 -pix_fmt yuv420p 30fps.mp4