We have three AXIS 211A IP camera and here is the simple, but working solution for the live view:
These cams have "Still Image" service over the streams. These still images are normal JPG files, which are suitable with Software Remote. I've created a Script Device per cams with three properties: CamIP for IP address of that cam, CamFrameSpeed for the changing frequency of images and CamDisplayedFrame for image, which is displayed in software remote panel (the Allow Same Value Changes option has to be checked). On panel I've created a dinamic image control pointed to this script device and it's CamDisplayedFrame property. The script:
Code: Select all
' ------------------------------------------------------------------------------------------
'
' File: CameraHandler.vbs
' Author: Ménesi László
' Desc:
' Usage:
'
' ------------------------------------------------------------------------------------------
Option Explicit
On Error Resume Next
Dim iFrameSpeed
Dim strCamIP, strCamLocalFile
strCamIP = GetPropertyValue ("Camera 1.CamIP")
strCamLocalFile = "C:\Program Files\HouseBot\Config\Themes\Touch_800x600\Cam1.jpg"
Do
iFrameSpeed = GetPropertyValue ("Camera 1.CamFrameSpeed")
DownloadFrame "http://" & strCamIP & "/jpg/image.jpg", strCamLocalFile
SetPropertyValue "Camera 1.CamDisplayedFrame", strCamLocalFile
Sleep (CInt (iFrameSpeed))
Loop
Sub DownloadFrame (strImageURL, strLocalFile)
Dim objHTTP
Dim objStream
Dim iNumber
Set objHTTP = CreateObject("Microsoft.XMLHTTP")
objHTTP.Open "GET", strImageURL, False
objHTTP.Send
iNumber = 0
Do
If objHTTP.readyState=4 Then
Exit Do
End If
If iNumber=12 Then
Exit Sub
End If
iNumber = iNumber + 1
Sleep(20)
Loop
Set objStream = CreateObject("ADODB.Stream")
objStream.Type = 1 ' 1 = Binary Type
objStream.Open
objStream.Write objHTTP.responseBody
objStream.SaveToFile strLocalFile, 2 ' 2 = Create and overwrite a file if it already exists
objStream.Close
Set objStream = Nothing
Set objHTTP = Nothing
End Sub
' ------------------------------------------------------------------------------------------
Thats all.