TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 12-06-2008, 06:04 AM   #1 (permalink)
The Wanderer
 
Join Date: Dec 2008
Posts: 10
Thanks: 0
moiseszaragoza is on a distinguished road
Default 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
moiseszaragoza is offline  
Reply With Quote
Old 12-06-2008, 02:30 PM   #2 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

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!
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 12-06-2008, 08:18 PM   #3 (permalink)
The Wanderer
 
Join Date: Dec 2008
Posts: 10
Thanks: 0
moiseszaragoza is on a distinguished road
Default

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 is offline  
Reply With Quote
Old 12-06-2008, 08:29 PM   #4 (permalink)
The Wanderer
 
Join Date: Dec 2008
Posts: 10
Thanks: 0
moiseszaragoza is on a distinguished road
Default

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
Attached Files
File Type: zip sample_sorenson.mov.zip (74.6 KB, 18 views)
moiseszaragoza is offline  
Reply With Quote
Old 12-06-2008, 10:35 PM   #5 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

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.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 12-11-2008, 02:05 AM   #6 (permalink)
The Wanderer
 
Join Date: Dec 2008
Posts: 10
Thanks: 0
moiseszaragoza is on a distinguished road
Default

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");
    } 
moiseszaragoza is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Defining your World: All About Constants Wildhoney General 15 01-29-2013 12:32 PM
10 PHP Myths Dispelled Wildhoney General 9 06-15-2009 06:55 AM
Looking for PHP Programmers to hire Andrew The Lounge 2 11-30-2008 03:51 AM
PHP Compressor Kalle Script Giveaway 8 05-28-2008 12:14 AM
Make html pages work like php sam Tips & Tricks 2 02-09-2007 01:00 PM


All times are GMT. The time now is 06:40 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design