Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
How can I run the commands for ffmpeg in php
Old 08-16-2007, 08:14 PM How can I run the commands for ffmpeg in php
goheadtry's Avatar
Webmaster Talker

Posts: 730
Name: John
Location: United States of America, California
Trades: 0
I had my host install the ffmpeg binary for site but I don't know how to execute the binary using PHP HELP would be greatly appreciated

Could I please get some examples or maybe a PHP class or some examples it is already installed but I was wondering how to use it with PHP

I have a linux server
__________________
Free $1 gift card when you signup at
Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

goheadtry is offline
Reply With Quote
View Public Profile Visit goheadtry's homepage!
 
 
Register now for full access!
Old 08-16-2007, 09:40 PM Re: How can I run the commands for ffmpeg in php
goheadtry's Avatar
Webmaster Talker

Posts: 730
Name: John
Location: United States of America, California
Trades: 0
I found this script (BOTTOM OF POST) does anybody know how to make a dynamic version that will create the flv file then automatically write information to the database after it is done encoding the flv?
More like an upload form with with writing to a mysql DATABASE

PHP Code:
<?php
// Set our source file
$srcFile "/path/to/clock.avi";
$destFile "/path/to/clock.flv";
$ffmpegPath "/path/to/ffmpeg";
$flvtool2Path "/path/to/flvtool2";
// Create our FFMPEG-PHP class
$ffmpegObj = new ffmpeg_movie($srcFile);
// Save our needed variables
$srcWidth makeMultipleTwo($ffmpegObj->getFrameWidth());
$srcHeight makeMultipleTwo($ffmpegObj->getFrameHeight());
$srcFPS $ffmpegObj->getFrameRate();
$srcAB intval($ffmpegObj->getAudioBitRate()/1000);
$srcAR $ffmpegObj->getAudioSampleRate();
// Call our convert using exec()
exec($ffmpegPath " -i " $srcFile " -ar " $srcAR " -ab " $srcAB " -f flv -s " $srcWidth "x" $srcHeight " " $destFile " | " $flvtool2Path " -U stdin " $destFile);
// Make multiples function
function makeMultipleTwo ($value)
{
    
$sType gettype($value/2);
    if(
$sType == "integer")
    {
        return 
$value;
    } else {
        return (
$value-1);
    }
}
?>
__________________
Free $1 gift card when you signup at
Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE


Last edited by goheadtry; 08-16-2007 at 09:50 PM..
goheadtry is offline
Reply With Quote
View Public Profile Visit goheadtry's homepage!
 
Reply     « Reply to How can I run the commands for ffmpeg in php
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.19275 seconds with 12 queries