Conceptronic

From ZoneMinder Wiki
Jump to: navigation, search

C54NETCAM - Just turn off PCRE processing in the Options > Network tab. http://x.x.x.x/video.cgi gives 10-20 fps 640 x 480 mjpeg feed. Seems to be the same camera as TrendNet IP-100 Additional: Disable login at the C54NETCAM -> Configuration -> User by using empty username and empty password

C54NetCam2 - it does send some form of motion jpeg with bad headers and so on.

The following php script does the trick

<?php
function handlejpeg($bork,$i) {
  $jpeg=substr($bork,28);
  echo "--video boundary--\r\n";
  echo "Content-length: ".strlen($jpeg)."\r\n";
  echo "Content-type: image/jpeg\r\n";
  echo "\r\n";
  echo $jpeg."\r\n";
}
  @ini_set('zlib.output_compression', 0);
  @ini_set('implicit_flush', 1);
  Header('Content-Type: multipart/x-mixed-replace;boundary=--video boundary--');
  $handle = fopen("http://<YOURHOSTNAME>/cgi/mjpg/mjpeg.cgi", "r");	
  $start=0;
  if ($handle) {
    while (!feof($handle)) {
        $buffer = fgets($handle, 409600);
        if($start==0 && $buffer=="--myboundary\r\n") {
          $crap = fgets($handle, 409600);
          $crap = fgets($handle, 409600);
          $start=1;
          $jpeg=fgets($handle, 409600);
        } elseif($start==1) {
          if(preg_match("/--myboundary\r\n/",$buffer)) { 
            $jpeg.=preg_replace("/--myboundary\r\n/","",$buffer);
            $i++;
            handlejpeg($jpeg,$i);
            $crap = fgets($handle, 409600);
            $jpeg=fgets($handle, 409600);
            $jpeg="";
          } else {
            $jpeg.=$buffer;
          }
        }
        
        flush();
    }
    fclose($handle);
}
?>