Skip to content

Commit

Permalink
Merge pull request #485 from florian-asche/patch-1
Browse files Browse the repository at this point in the history
Update FI9821W_Y2k.pm
  • Loading branch information
knight-of-ni committed Jul 22, 2014
2 parents 864f681 + fa67e21 commit 05cf606
Showing 1 changed file with 23 additions and 22 deletions.
45 changes: 23 additions & 22 deletions scripts/ZoneMinder/lib/ZoneMinder/Control/FI9821W_Y2k.pm
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ sub printMsg
}

sub sendCmd
{
{
my $self = shift;
my $cmd = shift;
my $result = undef;
Expand All @@ -135,13 +135,13 @@ sub reset
my $cmd = "setOSDSetting%26isEnableTimeStamp%3D0%26isEnableDevName%3D1%26dispPos%3D0%26isEnabledOSDMask%3D0";
$self->sendCmd( $cmd );
# Setup For Stream=0 Resolution=720p Bandwith=4M FPS=30 KeyFrameInterval/GOP=100 VBR=ON
my $cmd = "setVideoStreamParam%26streamType%3D0%26resolution%3D0%26bitRate%3D4194304%26frameRate%3D30%26GOP%3D100%26isVBR%3D1";
$cmd = "setVideoStreamParam%26streamType%3D0%26resolution%3D0%26bitRate%3D4194304%26frameRate%3D30%26GOP%3D100%26isVBR%3D1";
$self->sendCmd( $cmd );
# Setup For Infrared AUTO
my $cmd = "setInfraLedConfig%26Mode%3D1";
$cmd = "setInfraLedConfig%26Mode%3D1";
$self->sendCmd( $cmd );
# Reset image settings
my $cmd = "resetImageSetting";
$cmd = "resetImageSetting";
$self->sendCmd( $cmd );
}

Expand All @@ -150,10 +150,10 @@ sub moveStop
my $self = shift;
Debug( "Move Stop" );
my $cmd = "ptzStopRun";
$self->sendCmd( $cmd );
my $cmd = "setDevName%26devName%3D.";
$self->sendCmd( $cmd );
$cmd = "setDevName%26devName%3D.";
$self->sendCmd( $cmd );
my $cmd = "setOSDSetting%26isEnableDevName%3D1";
$cmd = "setOSDSetting%26isEnableDevName%3D1";
$self->sendCmd( $cmd );
}

Expand Down Expand Up @@ -184,15 +184,15 @@ sub moveConUp
if ( $tiltspeed < 0 ) {
$tiltspeed = 0;
}
Debug( "Move Up" );
Debug( "Move Up" );
if ( $osd eq "on" )
{
my $cmd = "setDevName%26devName%3DMove Up $tiltspeed";
$self->sendCmd( $cmd );
}
my $cmd = "setPTZSpeed%26speed%3D$tiltspeed";
$self->sendCmd( $cmd );
my $cmd = "ptzMoveUp";
$cmd = "ptzMoveUp";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
Expand All @@ -219,7 +219,7 @@ sub moveConDown
}
my $cmd = "setPTZSpeed%26speed%3D$tiltspeed";
$self->sendCmd( $cmd );
my $cmd = "ptzMoveDown";
$cmd = "ptzMoveDown";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
Expand All @@ -244,7 +244,7 @@ sub moveConLeft
}
my $cmd = "setPTZSpeed%26speed%3D$panspeed";
$self->sendCmd( $cmd );
my $cmd = "ptzMoveLeft";
$cmd = "ptzMoveLeft";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
Expand Down Expand Up @@ -272,7 +272,7 @@ sub moveConRight
}
my $cmd = "setPTZSpeed%26speed%3D$panspeed";
$self->sendCmd( $cmd );
my $cmd = "ptzMoveRight";
$cmd = "ptzMoveRight";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
Expand All @@ -299,7 +299,7 @@ sub moveConUpLeft
}
my $cmd = "setPTZSpeed%26speed%3D$tiltspeed";
$self->sendCmd( $cmd );
my $cmd = "ptzMoveTopLeft";
$cmd = "ptzMoveTopLeft";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
Expand All @@ -326,7 +326,7 @@ sub moveConUpRight
}
my $cmd = "setPTZSpeed%26speed%3D$tiltspeed";
$self->sendCmd( $cmd );
my $cmd = "ptzMoveTopRight";
$cmd = "ptzMoveTopRight";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
Expand All @@ -353,7 +353,7 @@ sub moveConDownLeft
}
my $cmd = "setPTZSpeed%26speed%3D$tiltspeed";
$self->sendCmd( $cmd );
my $cmd = "ptzMoveBottomLeft";
$cmd = "ptzMoveBottomLeft";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
Expand All @@ -380,7 +380,7 @@ sub moveConDownRight
}
my $cmd = "setPTZSpeed%26speed%3D$tiltspeed";
$self->sendCmd( $cmd );
my $cmd = "ptzMoveBottomRight";
$cmd = "ptzMoveBottomRight";
$self->sendCmd( $cmd );
$self->autoStop( $self->{Monitor}->{AutoStopTimeout} );
}
Expand All @@ -396,7 +396,7 @@ sub zoomConTele
}
my $cmd = "setInfraLedConfig%26mode%3D1";
$self->sendCmd( $cmd );
my $cmd = "openInfraLed";
$cmd = "openInfraLed";
$self->sendCmd( $cmd );
}

Expand All @@ -411,7 +411,7 @@ sub zoomConWide
}
my $cmd = "setInfraLedConfig%26mode%3D1";
$self->sendCmd( $cmd );
my $cmd = "closeInfraLed";
$cmd = "closeInfraLed";
$self->sendCmd( $cmd );
}

Expand All @@ -425,7 +425,7 @@ sub wake
$self->sendCmd( $cmd );
}
my $cmd = "setInfraLedConfig%26mode%3D0";
$self->sendCmd( $cmd );
$self->sendCmd( $cmd );
}

sub focusConNear
Expand All @@ -445,7 +445,7 @@ sub focusConNear
{
my $cmd = "setDevName%26devName%3DSharpness $speed";
$self->sendCmd( $cmd );
my $cmd = "setOSDSetting%26isEnableDevName%3D1";
$cmd = "setOSDSetting%26isEnableDevName%3D1";
$self->sendCmd( $cmd );
}
my $cmd = "setSharpness%26sharpness%3D$speed";
Expand Down Expand Up @@ -668,7 +668,7 @@ sub presetSet
my $cmd = "setDevName%26devName%3DSet Preset $preset";
$self->sendCmd( $cmd );
}
my $cmd = "ptzAddPresetPoint%26name%3D$preset";
$cmd = "ptzAddPresetPoint%26name%3D$preset";
$self->sendCmd( $cmd );
}
}
Expand All @@ -687,7 +687,7 @@ sub presetGoto
}
my $cmd = "setPTZSpeed%26speed%3D0";
$self->sendCmd( $cmd );
my $cmd = "ptzGotoPresetPoint%26name%3D$preset";
$cmd = "ptzGotoPresetPoint%26name%3D$preset";
$self->sendCmd( $cmd );
}
}
Expand Down Expand Up @@ -744,3 +744,4 @@ at your option, any later version of Perl 5 you may have available.
=cut

4 comments on commit 05cf606

@florian-asche
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But there is still the nasty Problem, that i cant deactivate the OSD :(

@knight-of-ni
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The manual says you can turn it off.
http://foscam.us/downloads/FI9821W%20user%20manual.pdf
See page 43.

@florian-asche
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i know. But the script turns it back on. Dont know where. Deactivated already all the reset stuff and sett off on osd setting but it didnt work...

@knight-of-ni
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it is setting that in the reset subroutine. See line 135. I'm not sure I agree with that or with some of the other parameters being sent to the camera during a rest either e.g. 30 fps. From the cgi manual, it looks like the camera has a reset command called sysreset.cgi. That might be what the reset sub should call rather than hard coding paramters, but you'd have to try and it see.

Please sign in to comment.