FFMpeg Video to Image Gallery


Hits: 2936  

1. FFMpeg create images using video source

# ffmpeg -i video.mp4 -s 560×315 images/image%d.jpg

2. Create image sequence gallery

<?php

$files = array();

foreach (glob("images/*.jpg") as $filename) {
$files[] = $filename;
}
natsort($files);

?>



<div id="slideshow">

<?php $i=1; foreach ($files as $filename) { 
if($i%15==0) { ?>
<img src="<?php echo $filename; ?>" <?php if($i==15) { ?> class="active" <?php } ?> />
<?php } $i++; } ?>

</div>

3. Synchronize images with video

$(function() {
    setInterval( "slideSwitch()", 1000 );
});

Demo for Image Sequence

Published by

Sandeep Verma

I’m an Entrepreneur. I’m proud to work as Blogger, LAMP Programmer, Linux Admin, Web Consultant, Cloud Manager, Apps Developer, Searcher. Concentrate > Observe > Imagine > Launch