Creating videos#

Creating a video from a set of images is simple with ffmpeg:

This assumes that the files are called 1.png, 2.png, etc, like the ones created by the screenshot loop above. Because %d in the pattern specifically means an integer without leading zeros FFmpeg inserts the images into the video in numeric order, which is typically what you want. You can also use -pattern_type glob -i './*.png' to match a glob. This is useful for alphabetically ordered files (for example, screenshots with RFC 3339 datetimes like “2101-12-31 23:59:59.png”). Just be aware that alphabetic ordering is not the same as numeric ordering:

 

This page is a preview of The newline Guide to Bash Scripting

No discussions yet