Proc_open read and parse output - real-time
<p>When I run proc_open with a file.txt path for the stderr output, that file is constantly updated every couple seconds with output of the proc_open program I am running which is ffmpeg. I just want to redirect that output to a phpfile where it can be read and parsed but while the process is running (so send info every couple seconds) so I can update a database. IS this possible? <strong>I have been googling for hours so if there are any experts out there who actually know how to use this function of have experience in this I would greatly appreciate any help.</strong></p>

<p>this puts output in a text doc. If I change to 2 => array("pipe","w") and the echo the output only comes on my screen at the end of the process</p>

<pre><code>$descriptorspec = array(
0 =&gt; array("pipe","r"),
1 =&gt; array("pipe","w"),
2 =&gt; array("file","/home/g/Desktop/test.txt","a")
) ;

$cwd = './' ;
// open process /bin/sh
$process = proc_open("/usr/local/bin/ffmpeg -i /home/g/Desktop/vid.wmv /home/g/Desktop/vid.flv", $descriptorspec, $pipes, $cwd) ;
</code></pre>
