Jump to content
Forumu Destekleyenlere Katılın ×
Paticik Forumları
2000 lerden beri faal olan, çok şukela bir paylaşım platformuyuz. Hoşgeldiniz.

ffmpeg ve upload sorunu


zarekd

Öne çıkan mesajlar

script çalışmıyor bir türlü 3-4 saat uğraştım başarıyla ffmpeg yükledim ama bu scripti çalıştıramadım. biraz kodla oynadım exec komutu ile ilgili bir sorun var $output dediğim zaman array () çıkıyor.


uploadvideopro.php şeklindeki sayfa aşağıda:

<?
/***************Load FFMPEG *********************************/



$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_fullnamen");

}



/***********************************************************/



/*****************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");

}

?>


bu da upload.php

<form name="frm" action="uploadvideopro.php" method="post" enctype="multipart/form-data" >

<input name="x_URL" type="file" class="form1"
size="26">

<input type="submit" name="submit" value="upload"
>

</form>
Link to comment
Sosyal ağlarda paylaş


print_r($output);



dene.

Bir de hatalari falan gostert. Bir cok sebebi olabilir ki cogu sunucu ya da default config ile alakalidir. Hele de standart kurulumla bir kontrol paneli kurduysan (mesela plesk) az biraz ellesmen gerekecek config dosyalariylan falan.
Link to comment
Sosyal ağlarda paylaş

yok sanırım hataları gösterme fonksiyonu kapalı. php.ini den mi açıyoruz nereden açıyoruz ?
plesk değil turbopanel godaddy vds


said:

echo "hebele ";


$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_fullnamen");

}



/************************************************** *********/




/*****************Get the path to Extention ****************/



$array_path = explode("/",$_SERVER['SCRIPT_FILENAME']);

$dynamic_path = "";

for ($i=0;$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 *****************************/






exec("ffmpeg -i /davet/movies/test.avi
-sameq -acodec mp3 -ar 22050 -ab 32 -f flv -s 320x240 /davet/movies/test.flv",$output);


print_r($output);


echo "

dynamic $dynamic_path


movie $moviepath


dosya adı
$fileName


flv $flvpath


array $array_path

";

print_r($output);

?>


dedim

hebele Array ( ) dynamic /home/hebele/public_html/davet
movie movies/
dosya adı
flv flvfiles/
array Array Array ( ) oldu
Link to comment
Sosyal ağlarda paylaş

çalışan kod şu şekilde:

ini_set('display_error',1);
error_reporting(E_ALL);

$extension = "ffmpeg";
$extension_soname = $extension . "." . PHP_SHLIB_SUFFIX;
$extension_fullname = PHP_EXTENSION_DIR . "/" . $extension_soname;



echo "yüklenmeye çalışıyor";


$command = "ffmpeg -i /home/peuni/public_html/davet/movies/peter.mpg -sameq -acodec libmp3lame -ar 22050 -ab 56k -f flv -s 320x240 /home/peuni/public_html/davet/movies/test4.flv";
exec($command,$status);
echo "Exit status code of command is $status";


$result = exec('whoami');

echo "$result";

?>

uğraşa uğraşa yaptım sonunad
Link to comment
Sosyal ağlarda paylaş

×
×
  • Yeni Oluştur...