Creating a mosaic from a video and extracting frames for scene changes

This is a very cool feature buried down in the ffmpeg documentation that let’s you generate a very nice mosaic of pictures from a video based on scenecuts.

Commands:

ffmpeg -i video.avi -vf select='gt(scene\,0.4)',scale=160:120,tile -frames:v 1 preview.png

Sample result below

preview

You can also use this to output an individual frame for every video, example follows:

ffmpeg -i ../source/dig_720p.mp4 -vf select='gt(scene\,0.6)' -vsync vfr preview%04d.png

The results of this could be used for a preview track of the video as per the below:

preview0018 preview0019 preview0020 preview0016 preview0017 preview0014 preview0015 preview0011 preview0012preview0016 preview0001 preview0002 preview0003 preview0004 preview0005 preview0006 preview0007 preview0008 preview0009 preview0010 preview0011 preview0012

 

Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>