\n"; echo "\n"; $session = $_REQUEST['session']; exec('echo ' .$session .' >/tmp/aa'); // First check that we are allowed to create a new encoding process if (($session == "") || !count(glob('ram/' .$session))) { $nbencprocess = exec("find ram/ -name segmenter.pid | wc | awk '{ print $1 }'"); if ($nbencprocess >= $maxencodingprocesses) echo "errorError: maximun number of sessions reached\n"; else echo "errorError: cannot create session\n"; } else { $cnt = 0; while ( ( count(glob('ram/' .$session . '/*.ts')) < 2 ) && ( $cnt < 25 ) ) { // wait for stream available sleep(1); $cnt++; } if ( count(glob('ram/' .$session . '/*.ts')) < 2 ) echo "errorError: encoding did not start correclty\n"; else echo "ok\n"; } echo "\n"; ?>