rondog Posted August 31, 2010 Share Posted August 31, 2010 I am trying to make a thumbnail from an FLV using ffmpeg and ffmpeg-php. I got them all installed. This is my script: <?php $extension = "ffmpeg"; $extension_soname = $extension . "." . PHP_SHLIB_SUFFIX; $extension_fullname = PHP_EXTENSION_DIR . "/" . $extension_soname; // load extension if(!extension_loaded($extension)) { dl($extension_soname) or die("Can't load extension $extension_fullname\n"); } include("../connect.php"); header("Content-type: image/jpeg"); $id = $_GET['id']; $query = mysql_query("SELECT filename FROM video WHERE id = '$id'"); $result = mysql_fetch_array($query); $moviefile = "../../../../armsmedia/videos/".$result['filename']; $mov = new ffmpeg_movie($moviefile,false); $img = $mov->getFrame(1); $showImg = $img->toGDImage(); $mkNewImg = new ffmpeg_frame($showImg); $maxWid = 150; $oldWid = $mkNewImg->getWidth(); if($oldWid > $maxWid) { $newWid = $maxWid; } $newHgt = $newWid / $movRatio; $mkNewImg->resize($newWid,$newHgt); $newImg = $mkNewImg->toGDImage(); imagejpeg($newImg,$mkThumbFile,40); imagedestroy($newImg); ?> I get a 500 Internal server error so I checked my apache logs and it is saying: Unable to locate ffmpeg_frame resource in this object. in /var/www/html/inc/video/thumbnail.php on line 24 which is pointing to: $oldWid = $mkNewImg->getWidth(); If I do a print_r($showImg) it returns: Resouce id #7 Any ideas? Link to comment https://forums.phpfreaks.com/topic/212217-unable-to-locate-resource-in-this-object/ Share on other sites More sharing options...
rondog Posted August 31, 2010 Author Share Posted August 31, 2010 edited the last part of my question Link to comment https://forums.phpfreaks.com/topic/212217-unable-to-locate-resource-in-this-object/#findComment-1105808 Share on other sites More sharing options...
rondog Posted August 31, 2010 Author Share Posted August 31, 2010 I am starting to think their is a problem with my GD Library. This is the API docs for ffmpeg_frame() http://ffmpeg-php.sourceforge.net/doc/api/ffmpeg_frame.php and it is saying it will be unavailable if GD is not enabled, however, my php info says it is enabled.. Link to comment https://forums.phpfreaks.com/topic/212217-unable-to-locate-resource-in-this-object/#findComment-1105819 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.