Jump to content

php + ffmpeg + feedback?


nicholasstephan

Recommended Posts

Hey,

 

I'm using flash to call a php script that in tern calls ffmpeg to convert some video. It all works great, except I can't get ffmpeg to give me any kind of status reporting. How do I know when ffmpeg has finished processing the video? Right now the task just ends and there's a broken link on my page for a couple of minutes while ffmpeg does it's thing...

Link to comment
https://forums.phpfreaks.com/topic/140413-php-ffmpeg-feedback/
Share on other sites

yeah... I think I found this function on here (or something like it anyway)...

 

$movieOptions['f'] = "flv" ;

$movieOptions['b'] = "100k" ;

$movieOptions['ab'] = "32k" ;

$movieOptions['ac'] = "1" ;

.

.

.

 

buildExec($movieOptions, $movieName . ".flv") ;

 

function buildExec($optArr, $outFile) {

$exec = "/usr/local/bin/ffmpeg " ;

foreach($optArr as $option => $value) {

$exec .= "-" . $option . " " . $value . " " ;

}

$exec .= $outFile ;

$outArr = Array() ;

$code = "" ;

exec($exec, $outArr, $return_var) ;

}

 

 

what I'd like to do is set up a php/flash socket so I can put up some kind of progress indicator... but to do that I need exec to either throw progress events or be able to query the operation somehow.

 

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/140413-php-ffmpeg-feedback/#findComment-734880
Share on other sites

yeah - I used $return_var for testing, but it only seems to tell me whether or not the command was valid, or any errors that cropped up. Even if I can't get real-time reporting, is there a way I can check see if it's done (other than an infinite loop to see if the file is there and not 0kb)?

 

you mentioned an ffmpeg extension (something I haven't even looked at). Would this be a better option? If so, can you point me towards some documentation or tutorials?

 

 

thanks again

Link to comment
https://forums.phpfreaks.com/topic/140413-php-ffmpeg-feedback/#findComment-734893
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.