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