Hey guys I just attempted to install ffmpeg on my home computer so I can test my php scripts. I completed the following steps and still have the dl error stated below anyone have any ideas?
-Download the zip file that includes the ffmpeg-php extension here and uncompress it. It includes several other software packages, you can ignore them, the files that we are interested in are in the ffmpeg-php-win32-all directory.
-Copy the avcodec-51.dll, avformat-51.dll, avutil-49.dll and pthreadGC2.dll files to the c:\windows\system32 directory.
-Copy the php_ffmpeg.dll file to your PHP extensions directory. For me, this was "C:\Program Files\SWsoft\Plesk\Additional\PleskPHP5\ext"
- Edit your php.ini file and add the following bit. For me this was located at "C:\Program Files\SWsoft\Plesk\Additional\PleskPHP5\php.ini"
extension=php_ffmpeg.dll
I still get the error:
Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=php_ffmpeg.dll in your php.ini in C:\Web Files\wamp\www\browsestart\includes\videoupload.php on line 26
Can't load extension C:\php5/php_ffmpeg.dll
ffmpeg dl error...any ideas?
Moderator: General Moderators
-
scarface222
- Forum Contributor
- Posts: 354
- Joined: Thu Mar 26, 2009 8:16 pm
Re: ffmpeg dl error...any ideas?
Did you restart your PHP server after editing php.ini?
Edit: This post was recovered from search engine cache.
Edit: This post was recovered from search engine cache.
Last edited by McInfo on Tue Jun 15, 2010 3:45 pm, edited 1 time in total.
-
scarface222
- Forum Contributor
- Posts: 354
- Joined: Thu Mar 26, 2009 8:16 pm
Re: ffmpeg dl error...any ideas?
Yeah thanks man that's why I was confused. Even after the restart nothing changed.
-
scarface222
- Forum Contributor
- Posts: 354
- Joined: Thu Mar 26, 2009 8:16 pm
Re: ffmpeg dl error...any ideas?
Anyone else? Is there a step I am missing?
-
scarface222
- Forum Contributor
- Posts: 354
- Joined: Thu Mar 26, 2009 8:16 pm
Re: ffmpeg dl error...any ideas?
this is the script if it helps...I have no experience with ffmpeg so this is kind of confusing.
Code: Select all
<?php
/***************Load FFMPEG *********************************/
$extension = "php_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");
}
/***********************************************************/
/*****************Get the path to Extention ****************/
$array_path = explode("/",$_SERVER['SCRIPT_FILENAME']);
$dynamic_path = "";
for ($i=0;$i<sizeof($array_path)-1;$i++)
if($array_path[$i]!="")
$dynamic_path =$dynamic_path."/".$array_path[$i];
/**********************************************************/
/******************set folders*****************************/
$flvpath = "flvfiles/";
$moviepath = "movies/" ;
chmod($moviepath,0777);
chmod($flvpath,0777);
/*********************************************************/
/******************Upload and convert video *****************************/
if(isset($_FILES["x_URL"]))
{
$fileName = $_FILES["x_URL"]["name"];
$fileNameParts = explode( ".", $fileName );
$fileExtension = end( $fileNameParts );
$fileExtension = strtolower( $fileExtension );
if($fileExtension=="avi" || $fileExtension=="wmv" || $fileExtension=="mpeg"
|| $fileExtension=="mpg" || $fileExtension=="mov" )
{
if ( move_uploaded_file($_FILES["x_URL"]["tmp_name"],$moviepath.$_FILES["x_URL"]["name"])
)
{
if( $fileExtension == "wmv" ) {
exec("ffmpeg -i ".$dynamic_path."/".$moviepath."".$fileName."
-sameq -acodec mp3 -ar 22050 -ab 32 -f flv -s 320x240 ".$dynamic_path."/".$flvpath."myflv.flv");
}
if( $fileExtension == "avi" || $fileExtension=="mpg" ||
$fileExtension=="mpeg" || $fileExtension=="mov" ) {
exec("ffmpeg -i ".$dynamic_path."/".$moviepath."".$fileName."
-sameq -acodec mp3 -ar 22050 -ab 32 -f flv -s 320x240 ".$dynamic_path."/".$flvpath."myflv.flv");
}
/******************create thumbnail***************/
exec("ffmpeg -y -i ".$dynamic_path."/".$moviepath."".$fileName."
-vframes 1 -ss 00:00:03 -an -vcodec png -f rawvideo -s 110x90 ".$dynamic_path."/".$flvpath."myflv.png");
}
else
{
die("The file was not uploaded");
}
}
else
{
die("Please upload file only with avi, wmv, mov or mpg extension!");
}
}
else
{
die("File not found");
}
?>
Last edited by Benjamin on Thu May 07, 2009 9:07 pm, edited 1 time in total.
Reason: Changed code type from text to php.
Reason: Changed code type from text to php.