如何获取onvif ip摄像机的实际ptz最小值/最大值?

时间:2019-08-07 12:46:39

标签: c# wsdl ip-camera onvif

信息:

摄像机型号:Amcrest IP2M-841B ip摄像机

我编写了一个c#winform应用程序,该应用程序可以连接到任何onvif ip摄像机,并通过按钮单击之类的事件向其发送ptz命令。

我将以下wsdl用于

PTZ:https://www.onvif.org/ver20/ptz/wsdl/ptz.wsdl

媒体:http://www.onvif.org/onvif/ver10/media/wsdl/media.wsdl

问题:

如何通过onvif命令获取相机的最小/最大实际ptz值

到目前为止我尝试过的事情:

                  content = 'This page is used to preproccess data for the given files',

#below i try to output the application name
                  mainPanel(
                    textOutput("application_name")),
                  form = fluidPage( radioButtons("radio", h3("How many files do you wish to add"),
                                                 choices = list("1 File" = 1, "2 Files" = 2),selected = 1),
                                                #select input for single file
                                                conditionalPanel(
                                                condition = "input.radio == 1", 
                                                fluidRow(
                                                  selectInput("select_singlefile", h3("You selected one file"), 
                                                              choices = list("Choice 1" = 1, "Choice 2" = 2,
                                                                             "Choice 3" = 3), selected = 1)
                                                        )
                                              ),
....

...

//PTZ
var ptzEndpointAddress = new EndpointAddress($"http://{cameraAddress}/onvif/ptz");
_ptzClient = new PTZClient(commonCustomBinding, ptzEndpointAddress);
_ptzClient.Endpoint.EndpointBehaviors.Add(commonPasswordDigestBehavior);

//Get configuration options
var configs = _ptzClient.GetConfigurations();
_ptzConfOptions = _ptzClient.GetConfigurationOptions(configs[0].token);

这是我从这些值中得到的例子: onvif absolute min/max

但是,当我将摄像机平移到最左侧,右侧,底部或顶部时,我没有得到与最大值相同的值...

actual min/max 0

actual min/max 1

这些值对我来说毫无意义...

1 个答案:

答案 0 :(得分:1)

https://www.onvif.org/ver20/ptz/wsdl/ptz.wsdl中请求“ GetCompatibleConfigurations”