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
Does any one know of any PHP scripts that work with ffmpeg?
Old 03-22-2008, 11:51 PM Does any one know of any PHP scripts that work with ffmpeg?
goheadtry's Avatar
Webmaster Talker

Posts: 730
Name: John
Location: United States of America, California
Trades: 0
Does any one know of any free/opensource PHP scripts that work with ffmpeg? I have a site with site5 hosting company I have installed ffmpeg, but I have ran into to problems writing my own script that uses just plane old ffmpeg, not php-ffmpeg, becuase php-ffmpeg won't work because of privileges. If you don't know of any scripts I would like to ask some help writing one if that is okay?

SOme of the things are

I need to the files to be outputed in flv like this

mmddyyyyhmsmillasecond.flv for a video and mmddyyyyhmsmillasecond.jpg for the screenshot
__________________
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 03-24-2008, 03:05 AM Re: Does any one know of any PHP scripts that work with ffmpeg?
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
exec("ffmpeg -options") ?
__________________

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

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 03-29-2008, 05:33 PM Re: Does any one know of any PHP scripts that work with ffmpeg?
goheadtry's Avatar
Webmaster Talker

Posts: 730
Name: John
Location: United States of America, California
Trades: 0
I have found a script that is a youtube clone I only need the upload part in upload.php is there a way to make this script seperate from the rest of the script so I could use it in my site.(Just the upload part with the write to mysql?
Here is upload.php

how do I isolate just the upload part of the script?
PHP Code:
<?php
include("include/config.php");
session_start();
include(
"include/function.php");
chk_member_login();
isMailVerified();
if(
$config['enable_package']=="yes")
{
        
check_subscriber(100);
}


if(
$_REQUEST[action_upload]!="")
{
        if(
$_REQUEST[field_myvideo_title]==""){
            
$err="Upload: Please Provide a video title.";
        }
        elseif(
$_REQUEST[field_myvideo_descr]==""){
            
$err="Upload: Please Provide a video description.";
        }
        elseif(
$_REQUEST[field_myvideo_keywords]==""){
            
$err="Upload: Please provide tag/s.";
        }
        elseif(
count($_REQUEST[chlist])<|| count($_REQUEST[chlist])>3){
            
$err="Upload: Please check (1 to 3) channel/s.";
        }

        if(
$err==""){
            
$page "second";
            
STemplate::assign('secondpage',"second");
            
$listch=implode("|",$_REQUEST[chlist]);
            
STemplate::assign('listch',$listch);
            
$var "<script language=javascript>
                    var field_myvideo_title = 
$_REQUEST[field_myvideo_title];
                    var field_myvideo_descr = 
$_REQUEST[field_myvideo_descr];
                    var field_myvideo_keywords = 
$_REQUEST[field_myvideo_keywords];
                    var listch = 
$listch;
                    </script>"
;
            
STemplate::assign("var"$var);
        }
}
if(
$_POST[upload_final]!="")
{
        if(
$_FILES['field_uploadfile']['tmp_name']==""$err="Please provide the video location.";
        if(
$err=="" && $_FILES['field_uploadfile']['tmp_name']!="")
                {
                
$p=$_FILES['field_uploadfile']['name'];
                
$pos=strrpos($p,".");
                
$ph=strtolower(substr($p,$pos+1,strlen($p)-$pos));
                
/* Space in Megabytes (MB) */
                
$space round($_FILES['field_uploadfile']['size']/(1024*1024));
                if(
$config['enable_package']=="yes")
                {
                        
check_subscriber($space);
                }
                
                if((
$ph!="mpg" && $ph!="avi" && $ph!="mpeg" && $ph!="wmv" && $ph!="rm" && $ph!="dat") || $space>$config[max_video_size])
                
$err="Invalid Video Format.";
                }

        if(
$err=="")
        {
                
$sql="insert into video set
                        UID=
$_SESSION[UID],
                        title='
$_REQUEST[field_myvideo_title]',
                        description='
$_REQUEST[field_myvideo_descr]',
                        keyword='
$_REQUEST[field_myvideo_keywords]',
                        channel='0|
$_REQUEST[listch]|0',
                        space = '
$_REQUEST[space]',
                        addtime='"
.time()."',
                        adddate='"
.date("Y-m-d")."',
                        vkey='"
.mt_rand()."',
                        type='
$_REQUEST[field_privacy]',
                        filehome='
$_REQUEST[p]'";
                
$conn->execute($sql);
                
$vid=mysql_insert_id();
                
$vdoname=$vid.".".$ph;
             
                    if(isset(
$_FILES['field_uploadfile']['tmp_name']) && is_uploaded_file($_FILES['field_uploadfile']['tmp_name']))
                    {
                        
$ff $config[vdodir]."/".$vdoname;
                        if(
move_uploaded_file($_FILES['field_uploadfile']['tmp_name'], $ff))
                        {    
$mov = new ffmpeg_movie($ff);
                            
video_to_frame($ff,$vid,&$mov,$listch[0]);
                            
$duration=$mov->getDuration();
                            
exec("$config[ffmpeg] -i $config[vdodir]/$vdoname -acodec mp3 -ar 22050 -ab 32 -f flv $config[flvdodir]/".$vid.".flv");
                        }
                       
                    }
                
//END

                
$key=substr(md5($vid),11,20);
                
$sql="update video set
                        vdoname='
$vdoname',
                        flvdoname='"
.$vid.".flv',
                        duration='
$duration',
                        vkey='
$key' WHERE VID=$vid";
                
$conn->execute($sql);
        
                if(
$config['enable_package']=="yes")
                {
                        
$sql "update subscriber set used_space=used_space+$space, used_bw=used_bw+$space, total_video=total_video+1 where UID=$_SESSION[UID]";
                        
$conn->execute($sql);
                }
        
                
header("Location:$config[baseurl]/upload_success.php?viewkey=$key&upload=yes&vid=$vid");
        }
}


STemplate::assign('err',$err);
STemplate::assign('msg',$msg);
STemplate::assign('head_bottom',"blank.tpl");
STemplate::display('head1.tpl');
STemplate::display('err_msg.tpl');
STemplate::display('upload.tpl');
STemplate::display('footer.tpl');
?>
Here is the youtube clone thing I found
Code:
http://www.filedropper.com/youtubeclone
__________________
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!
 
Old 03-31-2008, 01:02 AM Re: Does any one know of any PHP scripts that work with ffmpeg?
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
Read the "Handling file uploads" chapter from native php manual first. You absolutely don't understand how it works and you don't know what you are trying to do.
__________________

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

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Reply     « Reply to Does any one know of any PHP scripts that work with ffmpeg?
 

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.77265 seconds with 12 queries