View Single Post
Old 09-17-2007, 10:25 PM  
SmokeyTheBear
►SouthOfHeaven
 
SmokeyTheBear's Avatar
 
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
heres a simple dirty php script to take screenshots from a video and turn them into an animated gif

Code:
<?php
// define individual screenshot path

$t1 = "/home/account/public_html/videos/screenshot-1.jpg";
$t2 = "/home/account/public_html/videos/screenshot-2.jpg";
$t3 = "/home/account/public_html/videos/screenshot-3.jpg";
$t4 = "/home/account/public_html/videos/screenshot-4.jpg";

// define movie path
$targetmovie = "/home/account/public_html/videos/example.mpg"; 

//take screenshots

$fop = exec("/usr/local/bin/ffmpeg -i ".$targetmovie." -an -ss 1 -t 00:01:07 -r 1 -y -s qcif -f mjpeg ".$t1); 
echo $fop;
$fop = exec("/usr/local/bin/ffmpeg -i ".$targetmovie." -an -ss 2 -t 00:02:07 -r 1 -y -s qcif -f mjpeg ".$t2); 
echo $fop;
$fop = exec("/usr/local/bin/ffmpeg -i ".$targetmovie." -an -ss 3 -t 00:03:09 -r 1 -y -s qcif -f mjpeg ".$t3); 
echo $fop;
$fop = exec("/usr/local/bin/ffmpeg -i ".$targetmovie." -an -ss 4 -t 00:04:10 -r 1 -y -s qcif -f mjpeg ".$t4); 
echo $fop;

//make animated gif
$will = exec("/usr/bin/convert -delay 3 -loop 0 /home/account/public_html/videos/screenshot*.gif /home/account/public_html/videos/animated.gif");
echo $will;

?>

<img src=http://yoursite.com/videos/animated.gif>
you will need to modify the server path's according to your server settings..
__________________
hatisblack at yahoo.com
SmokeyTheBear is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote