Aviosys IP Kamera 9060 -success!!
Posted: Sat Feb 18, 2006 9:39 am
Hi,
I just wanted to let you all know I've had success with the IP Kamera 9060.
This camera works using the follwoing hacked Perl script.
#!/usr/bin/perl
use IO::Socket;
my $iphost="192.168.11.45:80";
my $frame_count=25;
my $image_filename="ip_Kamera_9060";
my $no_print_data;
my $target_path='/cgi-bin/Stream?Video';
my $debug=0;
sub main {
my ($heraddr);
RECONNECT:
$t=0;
print STDERR "connecting to $iphost\n";
do {
$F = IO::Socket::INET->new(
PeerAddr => $iphost,
Proto => "tcp",
Type => SOCK_STREAM,
Timeout => 10) ;
$t++;
die ("Socket fail : $!") if $t > 10;
} while( $F == undef );
print STDERR "Connnected\n";
$qu = "GET $target_path HTTP/1.0\r\n" .
"Accept: */*\r\n" .
"Keep-Alive: 300\r\n" .
"Connection: keep-alive\r\n" .
"Cookie: webcamPWD=RootCookie00000\r\n" .
"User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n" .
"\r\n";
print $F $qu;
#print $D $qu;
while ($j = read($F, $data, 20) ) {
#print " j = $j\n";
@a = unpack('v10', $data);
if ($debug) {
for $i ( 0 .. $#a ) {
#print $D "$i = $a[$i]\n";
print "$i = $a[$i]\n";
}
}
# make sure er got pre-image header.
unless ($a[0] == 10794 && $a[3] && $a[4] && $a[5]) {
close($F);
print STDERR "bad header image $image_filenam\n";
goto RECONNECT ;
}
#print STDERR "$image_filename : Size=$a[1]\tWidth=$a[3]\tHeight=$a[4],Compression-Level=$a[5]\n";
$j = read($F, $data, $a[1]) or die ("bad read: $!");
open(J, ">$image_filename.JPG");
print J $data;
close(J);
# $image_filename++;
#last unless --$frame_count;
}
}
&main;
exit;
I just wanted to let you all know I've had success with the IP Kamera 9060.
This camera works using the follwoing hacked Perl script.
#!/usr/bin/perl
use IO::Socket;
my $iphost="192.168.11.45:80";
my $frame_count=25;
my $image_filename="ip_Kamera_9060";
my $no_print_data;
my $target_path='/cgi-bin/Stream?Video';
my $debug=0;
sub main {
my ($heraddr);
RECONNECT:
$t=0;
print STDERR "connecting to $iphost\n";
do {
$F = IO::Socket::INET->new(
PeerAddr => $iphost,
Proto => "tcp",
Type => SOCK_STREAM,
Timeout => 10) ;
$t++;
die ("Socket fail : $!") if $t > 10;
} while( $F == undef );
print STDERR "Connnected\n";
$qu = "GET $target_path HTTP/1.0\r\n" .
"Accept: */*\r\n" .
"Keep-Alive: 300\r\n" .
"Connection: keep-alive\r\n" .
"Cookie: webcamPWD=RootCookie00000\r\n" .
"User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n" .
"\r\n";
print $F $qu;
#print $D $qu;
while ($j = read($F, $data, 20) ) {
#print " j = $j\n";
@a = unpack('v10', $data);
if ($debug) {
for $i ( 0 .. $#a ) {
#print $D "$i = $a[$i]\n";
print "$i = $a[$i]\n";
}
}
# make sure er got pre-image header.
unless ($a[0] == 10794 && $a[3] && $a[4] && $a[5]) {
close($F);
print STDERR "bad header image $image_filenam\n";
goto RECONNECT ;
}
#print STDERR "$image_filename : Size=$a[1]\tWidth=$a[3]\tHeight=$a[4],Compression-Level=$a[5]\n";
$j = read($F, $data, $a[1]) or die ("bad read: $!");
open(J, ">$image_filename.JPG");
print J $data;
close(J);
# $image_filename++;
#last unless --$frame_count;
}
}
&main;
exit;