I've multiple self-hosting network video security cameras (Axis 2100, they're pretty old) that I wish to broadcast to some website. The cameras support live streaming in MJPG format, but to be able to stream the recording from all of these cameras, I have to make sure they are public. For security reason, I wish to restrict the viewing of those cameras through this site where I'm able to authenticate the customers. Because the webcams take presctiption another host, I am using cURL and PHP to log to the cameras, obtain the MJPG image stream, and echo the live stream to be shown around the web page.

header('content-type: multipart/x-mixed-replace; boundary=--myboundary');

while (@ob_end_clean()); 
$ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'http://XX.XXX.XXX.XX/axis-cgi/mjpg/video.cgi?resolution=320x240'); 
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY | CURLAUTH_ANYSAFE );
    curl_setopt($ch, CURLOPT_USERPWD, 'USERNAME:PASSWORD');
    $im = curl_exec($ch);


echo $im;
curl_close($ch);

The issue is after i have multiple periods of attempting to gain access to exactly the same php page using the code above on a single browser, just one session get loaded as the relaxation continued to be blank and finally displayed a 500 internal server error. It really works when open it up through multiple different browsers, however, with degrade in performance.

Ultimately, I must turn it into a webcam server where I'm able to make one input stream connection from you and broadcast it to multiple clients.

This site is located by GoDaddy on the linux server, and I am this is not on a devoted server, and so i don't believe I recieve to set up any fancy free video stream hosting server.

Thanks and sorry for this type of lengthy publish.

-T.Ho