rondog Posted April 8, 2008 Share Posted April 8, 2008 Hey guys, I have a fairly large FLV database and I am using FFMPEG to create thumbnails dynamically so when a user uploads an FLV, it will automatically create a thumbnail. That works perfectly for me right now. My concern is that it calls createthumb.php every time in turn calling the ffmpeg program(in other words it isnt caching): <?php header("Content-type: image/jpeg"); $moviefile = $_GET['source']; $mov = new ffmpeg_movie($moviefile,false); $img = $mov->getFrame(50); $showImg = $img->toGDImage(); $mkNewImg = new ffmpeg_frame($showImg); $maxWid = 150; $oldWid = $mkNewImg->getWidth(); $oldHgt = $mkNewImg->getHeight(); $movRatio = $oldWid/$oldHgt; if($oldWid > $maxWid) { $newWid = $maxWid; } $newHgt = $newWid / $movRatio; $mkNewImg->resize($newWid,$newHgt); $newImg = $mkNewImg->toGDImage(); imagejpeg($newImg, $mkThumbFile,40); imagedestroy($newImg); ?> I am not sure how much overhead it produces, but I think what I would like to achieve is for the first time around, run this createthumb.php and actually store this thumbnail on the server, insert it into the database and then so the next time the user sees the flv it will first check if it has already been created and if not run createthumb.php any ideas? Link to comment https://forums.phpfreaks.com/topic/100163-saving-flv-thumbnails/ Share on other sites More sharing options...
rondog Posted April 8, 2008 Author Share Posted April 8, 2008 I guess i just need to know how to save this thumbnail to the server. I was looking at imagecopy, but I am not sure if thats the right way. How would I save this generated thumbnail to the serveR? Link to comment https://forums.phpfreaks.com/topic/100163-saving-flv-thumbnails/#findComment-512147 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.