TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Javascript, AJAX, E4X (http://www.talkphp.com/javascript-ajax-e4x/)
-   -   ffmpeg work with PHP (http://www.talkphp.com/javascript-ajax-e4x/3726-ffmpeg-work-php.html)

moiseszaragoza 12-06-2008 06:04 AM

ffmpeg work with PHP
 
i need to comvert mov, avi, and other video files to FLV on the fly. i hear that FFMPG does it but i cant find how it works

does any 1 know how does ffmpeg work with PHP

or have any samples file?

Thanks

Wildhoney 12-06-2008 02:30 PM

I worked with FFMPEG extensively about 2 years ago, and by far the best wrapper class I can recommend for use with FFMPEG is Yorsh's FFMPEG Wrapper Class. It is simply fantastic and will save you a lot of time! If you require any help with it, please just post a follow-up and I'll try my utmost to help you!

moiseszaragoza 12-06-2008 08:18 PM

Thanks
This has beeb really helpfull

I have been reading over the code and it seems self explanatory.
I will play with it a bit more

and Thanks again

moiseszaragoza 12-06-2008 08:29 PM

1 Attachment(s)
ok
i copy that code and save it in a file named ffmpegWrapperPHPclass.php that lives in the same directory as my index.php page.

the code in my index is
Code:


<?php  include("ffmpegWrapperPHPclass.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>


<body>

<form action="" method="post" enctype="multipart/form-data" name="form1" id="form1">
  <table width="760" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>File Lookup </td>
      <td><input type="file" name="file" /></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><input type="submit" name="Submit" value="Submit" /></td>
    </tr>
  </table>
</form>
</body>
</html>


and i need help to upload the file i attach and converted into a flv.

Thanks

Wildhoney 12-06-2008 10:35 PM

To convert the files what I did was constructed a command to run through FFMPEG. Which was:

Code:

ffmpeg -i "/home/adam/domains/File.avi" -s 430x256 -b 7000k -aspect 16:9 -ar 44100 -r 30 -ac 1 "File.flv"
You then exec() that and that begins the conversion from AVI to FLV.

moiseszaragoza 12-11-2008 02:05 AM

Thank you for all your help.

Ok i am having problems calling the functions inside the class.
I wonder if there is anything that i need installed on my server.

I know that i can upload a file and this is what i am doing

PHP Code:



function test(){
        
$uploaddir     =     '_files/';
            
$uploadfile =     $uploaddir basename($_FILES['file']['name']);
            
#$uploadfile =     $uploaddir . $_SESSION['UserID'] . date("YmdHis"). ".flv";  
            
$filename     =    basename($_FILES['file']['name']);
            
#$filename     =     $_SESSION['UserID'] . date("YmdHis"). ".flv";
            
if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) {
            
#    echo "File is valid, and was successfully uploaded.\n";
            
} else {
            
#    echo "Possible file upload attack!\n";
            
}
            
#echo 'Here is some more debugging info:';
            #print_r($_FILES);
            #echo($uploadfile);
            
YorshffmpegWrapper($$filename$ffmpeg_path "ffmpeg");
    } 



All times are GMT. The time now is 06:44 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0