Home AMX User Forum AMX General Discussion

Axis PTZ cams?

Anyone out there write a module for IP control yet? Want to share, if not, any pointers such as encryption type, base 64 or MD5, does it require session cookies, any thing bizarre to beware of?

I should be getting a couple of these cameras in a few days so I haven't had a chance to see how easy or how much of a pain in the butt they may be to control so any code or insight would be appreciated.

Comments

  • We have Axis IP PTZ cameras on one of our jobs and they work great.

    here is some sample code;
    DEFINE_FUNCTION AxisPTZ(INTEGER nIdx, CHAR Cmnd[])
    {
      SEND_STRING dvCameras[nIdx],"'GET /axis-cgi/com/ptz.cgi?camera=1&',Cmnd,13,10,'Connection: Keep-Alive',13,10,13,10"
    }
    
    
    BUTTON_EVENT[dvPnls_AXIS_Camera,nBtnCameraControl_AXIS]
    {
      PUSH :
      {
          STACK_VAR INTEGER nBtnIdx
          nBtnIdx = GET_LAST(nBtnCameraControl_AXIS)
          SWITCH(nBtnIdx)
          {
    	CASE 1:	// Tilt Up
    	{
    	  AxisPTZ(nOutA_ActiveCam,'move=up')
    	} 
    	CASE 2:	// Tilt Down
    	{
    	  AxisPTZ(nOutA_ActiveCam,'move=down')
    	} 
    	CASE 3:	// Pan Left
    	{
    	  AxisPTZ(nOutA_ActiveCam,'move=left')
    	} 
    	CASE 4:	// Pan Right
    	{
    	  AxisPTZ(nOutA_ActiveCam,'move=right')
    	} 
    	CASE 5:	// Zoom In
    	{
    	  AxisPTZ(nOutA_ActiveCam,'rzoom=200')
    	} 
    	CASE 6:	// Zoom Out
    	{
    	  AxisPTZ(nOutA_ActiveCam,'rzoom=-200')
    	} 
        }
    }
    
    

    Hope this helps
  • viningvining Posts: 4,368
    Cool, I was hoping it would be this simple! Thanks.
Sign In or Register to comment.