Някой може ли да работи с класове?

asddasasdds

Registered
Здравейте,

Става въпрос за този код:

Код:
<?php
Public Class Media_handler
{
function Convert_Media($filename, $rootpath, $inputpath, $outputpath, $width, $height, $bitrate, $samplingrate)
{
var $outfile = "";
// root directory path, where FFMPEG folder exist in your application.
var $rPath = $rootpath."\ffmpeg";
// which shows FFMPEG folder exist on the root.
'// Set Media Size that is width and hieght
var $size = $width."x".$height;
'// remove origination extension from file adn add .flv extension, becuase we must give output file name to ffmpeg command.
$outfile =$filename;

'// Media Size
$size  = Width & "x" & Height;

'// remove origination extenstion from file and add .flv extension , becuase we must give output filename to ffmpeg command.

$outfile = 'out_file.flv';
'// Use exec command to access command prompt to execute the following FFMPEG Command and convert video to flv format.

'// exec('command',output array,int return value)

$command = '/C'._rootpath."\ffmpeg -i "\".$inputpath."\".$filename. " -acodec mp3 -ar " .$samplingrate." -ab ".$bitrate."
-f flv -s ".$size." ".$outputpath."\".outfile;

'// return output file name for other operations
Return $outfile;
}


function set_buffering($filename,$rootpath,$path)

{
'// root directory path
$_rootPath = rootpath."\flvtool"


'// Execute FLV TOOL command also on exec , you can also use other tool for executing command prompt commands.

'// exec('command',output array,int return value)

$command = "/C".$_rootpath."\flvtool2 - U".Path;

'// Execute this command to set buffering for FLV
}




function($filename, $rootpath, $inputpath,$outputpath, $no_of_thumbs, $frame_number, $image_format, $width, $height)
{
'// root directory path
$_rootpath = rootpath."\ffmpeg";
'// Media Size
$size = width. "x".height;

'// I am using static image, you can dynamic it with your own choice.
$outfile = "sample.png";

'// exec('command',output array,int return value)

$command = "/C".$_rootpath."\ffmpeg -y -i " .$inputpath."\".filename." -vframes ".$no_of_thumbs." -ss 00:00:03 -an -vcodec ". $image_format." -f rawvideo -s ".$size. " ". $outputpath."\".$outfile;

'// Execute this command using exec command or any other tool to grab image from converted flv file.

Return $outfile;
}
}

Аз лично откривам много грешки, кода взех от http://www.iepak.com/30/topicdetail.aspx

Някой може ли да ми помогне с оправянето му :?

П.С. Искам да кажа, че не съм работил с класове :)
 
Е добре де никой ли не може да работи с класове :cry:
 
Самия клас няма как да ти даде грешка.
Има код дето е даден там допълнителен.
Трбява да се напише формуляр за качване на файловете
и е показано как трябва да изглежда input-a.

Код:
<input name="file1" id="file1" name="file1" />

Трябва да имаш директориите
$nputpath = $rootpath."/Default";
$outputpath = $rootpath. "/FLV"
$ThumbPath = $rootpath. "/Thumbs"

и понеже това е свързано с писане и тестване и затова още никой не ти е отговорил.

Нямам време в момента да погледна целия код и да го тествам.
 
//офф
брех станами интересно колко начина има да за да се използват тези класове
аз знаех само new Class и class::method
а сега и това $_mediahandler as new Media_handler
хм други начини имали ?
 
Добре а този код например няма ли да ми даде грешка?

Код:
'// exec('command',output array,int return value)

А този не е ли много объркан?

Код:
$command = '/C'._rootpath."\ffmpeg -i "\".$inputpath."\".$filename. " -acodec mp3 -ar " .$samplingrate." -ab ".$bitrate."
-f flv -s ".$size." ".$outputpath."\".outfile;

Смисъл такъв тия кавички не бъркат ли работата?

И този скрипт трябва да е в php файла нали?

Сори за многото въпроси, ама нещо не ми е ясно :oops:
 
UP, сори ама ми трябва :(
 

Back
Горе