[PHP] redirect a shell command to stdout in real time

2012-09-11 Thread zonyi besk
Hi All,

I want to redirect the stdout of an executing shell command to stdout of
php called by browser
The command some stream like command like
ffmpeg -i rtmp://192. -
rtmpdump -v  -r rtmp://192  -a app -y stream -o -
so its live video, and the execution not stops,  till the user navigate out
with browser.

What I want loading this php from web based,  to print the live video
content to the stdout of php,
So the call result of  php is video and starts almost with
header(Content-Type: video/x-flv);

Hope there's solution in php
Thanks
Zocs


Re: [PHP] redirect a shell command to stdout in real time

2012-09-11 Thread shiplu
You can use pipe to run the command and capture the stdout.
Then dump it with proper header to browser.

Note, If the external command (specially video encoding) takes long time
you should probably use cron for this and maintain a queue. I recommend you
apply some sorts of caching also.

-- 
Shiplu.Mokadd.im
ImgSign.com | A dynamic signature machine
Innovation distinguishes between follower and leader