nicholasstephan Posted January 11, 2009 Share Posted January 11, 2009 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 More sharing options...
trq Posted January 11, 2009 Share Posted January 11, 2009 Are you using the ffmpeg extension or simply calling the ffmpeg command somehow? Can we see some code? Link to comment https://forums.phpfreaks.com/topic/140413-php-ffmpeg-feedback/#findComment-734879 Share on other sites More sharing options...
nicholasstephan Posted January 11, 2009 Author Share Posted January 11, 2009 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 More sharing options...
trq Posted January 11, 2009 Share Posted January 11, 2009 Your not going to be able to get real time reporting, the last argument (to exec) however will give you the exit status of the executed command. Link to comment https://forums.phpfreaks.com/topic/140413-php-ffmpeg-feedback/#findComment-734889 Share on other sites More sharing options...
nicholasstephan Posted January 11, 2009 Author Share Posted January 11, 2009 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 More sharing options...
corbin Posted January 11, 2009 Share Posted January 11, 2009 Looping is pretty much the only way if you're going to use the ffmpeg CLI. I found a PHP extension with google, but it doesn't look like it converts. I think it just says info. http://ffmpeg-php.sourceforge.net/ Don't know if it's any good or not. Link to comment https://forums.phpfreaks.com/topic/140413-php-ffmpeg-feedback/#findComment-734897 Share on other sites More sharing options...
trq Posted January 11, 2009 Share Posted January 11, 2009 is there a way I can check see if it's done exec will return control to your main program when the command has finished. Link to comment https://forums.phpfreaks.com/topic/140413-php-ffmpeg-feedback/#findComment-734899 Share on other sites More sharing options...
corbin Posted January 11, 2009 Share Posted January 11, 2009 Oh yeah.... I'm used to people doing it with cron jobs in the background. x.x. Link to comment https://forums.phpfreaks.com/topic/140413-php-ffmpeg-feedback/#findComment-734904 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.