Request for Assistance: Debugging Zoom Functionality Issue with NX Witness API
AnsweredWe are currently integrating the NX Witness system into our platform and have encountered an issue with the Zoom in/out functionality while using the API /rest/v3/devices/{deviceId}/ptz/position.
When attempting to use this feature, we receive the following error response:
{
"error": "3",
"errorId": "cantProcessRequest",
"errorString": "Failed to get device PTZ position for Device"
}
Could you kindly assist us in debugging and clarifying why this issue is occurring? Specifically:
- Are there any known limitations or prerequisites for the PTZ (Pan-Tilt-Zoom) function in the API?
- Is there additional configuration required on the device or within the NX system to ensure proper functionality?
- Are there specific logs or diagnostic steps you would recommend to better understand this error?
Camera ID: ec50ae26-81bd-a323-ca00-037cd4eee8fa
Any guidance or support you can provide would be greatly appreciated. Please let us know if further information or access is needed to assist in resolving this issue.
{
"backupQuality": "CameraBackupDefault",
"capabilities": "inputPort|outputPort|audioTransmit|customMediaPorts|absoluteTimestamps|isOnvif",
"compatibleAnalyticsEngineIds": [
"{cd976852-0a24-3774-823a-a8e222c551f9}",
"{9537fc21-e0b1-3ca8-424f-385cf4e9a45a}"
],
"credentials": {
"password": "******",
"user": "admin"
},
"deviceType": "Camera",
"id": "{ec50ae26-81bd-a323-ca00-037cd4eee8fa}",
"isLicenseUsed": true,
"isManuallyAdded": true,
"logicalId": "",
"mac": "00-0F-0D-2A-F0-08",
"mediaCapabilities": {
"hasAudio": false,
"hasDualStreaming": true,
"maxResolution": "2592x1520",
"streamCapabilities": {
"primary": {
"defaultBitrateKbps": 0,
"defaultFps": 30,
"maxBitrateKbps": 7130,
"maxFps": 30,
"minBitrateKbps": 192
},
"secondary": {
"defaultBitrateKbps": 0,
"defaultFps": 30,
"maxBitrateKbps": 1531,
"maxFps": 30,
"minBitrateKbps": 192
}
}
},
"mediaStreams": [
{
"codec": 27,
"encoderIndex": 1,
"resolution": "1280x960",
"transcodingRequired": false,
"transports": "rtsp|hls|webrtc"
},
{
"codec": 27,
"encoderIndex": 0,
"resolution": "1920x1080",
"transcodingRequired": false,
"transports": "rtsp|hls|webrtc"
},
{
"codec": 0,
"encoderIndex": -1,
"resolution": "*",
"transcodingRequired": true,
"transports": "rtsp|webm|mjpeg|webrtc"
}
],
"model": "CAM6082QIR",
"motion": {
"mask": "5,0,0,44,32",
"recordAfterS": 5,
"recordBeforeS": 5,
"type": "none"
},
"name": "108路口型02",
"options": {
"backupContentType": "archive",
"backupPolicy": "byDefault",
"backupQuality": "CameraBackupDefault",
"dewarpingParams": "{\"cameraProjection\":\"equidistant\",\"enabled\":false,\"fovRot\":0,\"hStretch\":1,\"radius\":0.5,\"sphereAlpha\":0,\"sphereBeta\":0,\"viewMode\":\"ceiling\",\"xCenter\":0.5,\"yCenter\":0.5}",
"failoverPriority": "Medium",
"isAudioEnabled": false,
"isControlEnabled": true,
"isDualStreamingDisabled": false,
"preferredServerId": "{3159f676-e4d1-febc-56b6-089567aa3b9f}"
},
"parameters": {
"DeviceUrl": "http://192.168.92.74:80/onvif/device_service",
"availableProfiles": [
{
"name": "CH1_Streaming1",
"state": "primaryDefault",
"token": "pToken_0"
},
{
"name": "CH1_Streaming2",
"state": "secondaryDefault",
"token": "pToken_1"
}
],
"bitrateInfos": {
"streams": [
{
"actualBitrate": 1.8770160675048828,
"actualFps": 20.834949493408203,
"avarageBitrateMbps": -1,
"averageGopSize": 26,
"bitrateFactor": 1,
"bitratePerGop": false,
"encoderIndex": "primary",
"fps": 20,
"isConfigured": false,
"numberOfChannels": 1,
"rawSuggestedBitrate": 6.73046875,
"resolution": "1920x1080",
"suggestedBitrate": 1.8770160675048828,
"timestamp": "2025-01-22T06:08:19Z"
},
{
"actualBitrate": 0.2753868103027344,
"actualFps": 7.325236797332764,
"avarageBitrateMbps": -1,
"averageGopSize": 12.333333015441895,
"bitrateFactor": 1,
"bitratePerGop": false,
"encoderIndex": "secondary",
"fps": 7,
"isConfigured": false,
"numberOfChannels": 1,
"rawSuggestedBitrate": 1.6328125,
"resolution": "1280x960",
"suggestedBitrate": 0.2753868103027344,
"timestamp": "2025-01-22T06:11:16Z"
}
]
},
"defaultPreferredPtzPresetType": "system",
"deviceAgentsSettingsValuesProperty": [
{
"key": "{cd976852-0a24-3774-823a-a8e222c551f9}",
"value": {}
},
{
"key": "{9537fc21-e0b1-3ca8-424f-385cf4e9a45a}",
"value": {
"area10DetectionSensitivity": 50,
"area10DetectionsEnabled": [
"area10EntranceDetectionEnabled",
"area10ExitDetectionEnabled",
"area10AppearanceDetectionEnabled",
"area10DisappearanceDetectionEnabled",
"area10LoiteringDetectionEnabled",
"area10CrossingEnabled"
],
"area10LoiteringDetectionDuration": 10,
"area10Polygon": {},
"area1DetectionSensitivity": 50,
"area1DetectionsEnabled": [
"area1EntranceDetectionEnabled",
"area1ExitDetectionEnabled",
"area1AppearanceDetectionEnabled",
"area1DisappearanceDetectionEnabled",
"area1LoiteringDetectionEnabled",
"area1CrossingEnabled"
],
"area1LoiteringDetectionDuration": 10,
"area1Polygon": {},
"area2DetectionSensitivity": 50,
"area2DetectionsEnabled": [
"area2EntranceDetectionEnabled",
"area2ExitDetectionEnabled",
"area2AppearanceDetectionEnabled",
"area2DisappearanceDetectionEnabled",
"area2LoiteringDetectionEnabled",
"area2CrossingEnabled"
],
"area2LoiteringDetectionDuration": 10,
"area2Polygon": {},
"area3DetectionSensitivity": 50,
"area3DetectionsEnabled": [
"area3EntranceDetectionEnabled",
"area3ExitDetectionEnabled",
"area3AppearanceDetectionEnabled",
"area3DisappearanceDetectionEnabled",
"area3LoiteringDetectionEnabled",
"area3CrossingEnabled"
],
"area3LoiteringDetectionDuration": 10,
"area3Polygon": {},
"area4DetectionSensitivity": 50,
"area4DetectionsEnabled": [
"area4EntranceDetectionEnabled",
"area4ExitDetectionEnabled",
"area4AppearanceDetectionEnabled",
"area4DisappearanceDetectionEnabled",
"area4LoiteringDetectionEnabled",
"area4CrossingEnabled"
],
"area4LoiteringDetectionDuration": 10,
"area4Polygon": {},
"area5DetectionSensitivity": 50,
"area5DetectionsEnabled": [
"area5EntranceDetectionEnabled",
"area5ExitDetectionEnabled",
"area5AppearanceDetectionEnabled",
"area5DisappearanceDetectionEnabled",
"area5LoiteringDetectionEnabled",
"area5CrossingEnabled"
],
"area5LoiteringDetectionDuration": 10,
"area5Polygon": {},
"area6DetectionSensitivity": 50,
"area6DetectionsEnabled": [
"area6EntranceDetectionEnabled",
"area6ExitDetectionEnabled",
"area6AppearanceDetectionEnabled",
"area6DisappearanceDetectionEnabled",
"area6LoiteringDetectionEnabled",
"area6CrossingEnabled"
],
"area6LoiteringDetectionDuration": 10,
"area6Polygon": {},
"area7DetectionSensitivity": 50,
"area7DetectionsEnabled": [
"area7EntranceDetectionEnabled",
"area7ExitDetectionEnabled",
"area7AppearanceDetectionEnabled",
"area7DisappearanceDetectionEnabled",
"area7LoiteringDetectionEnabled",
"area7CrossingEnabled"
],
"area7LoiteringDetectionDuration": 10,
"area7Polygon": {},
"area8DetectionSensitivity": 50,
"area8DetectionsEnabled": [
"area8EntranceDetectionEnabled",
"area8ExitDetectionEnabled",
"area8AppearanceDetectionEnabled",
"area8DisappearanceDetectionEnabled",
"area8LoiteringDetectionEnabled",
"area8CrossingEnabled"
],
"area8LoiteringDetectionDuration": 10,
"area8Polygon": {},
"area9DetectionSensitivity": 50,
"area9DetectionsEnabled": [
"area9EntranceDetectionEnabled",
"area9ExitDetectionEnabled",
"area9AppearanceDetectionEnabled",
"area9DisappearanceDetectionEnabled",
"area9LoiteringDetectionEnabled",
"area9CrossingEnabled"
],
"area9LoiteringDetectionDuration": 10,
"area9Polygon": {},
"detectionFrequencyFps": 5,
"line10Polyline": {},
"line1Polyline": {},
"line2Polyline": {},
"line3Polyline": {},
"line4Polyline": {},
"line5Polyline": {},
"line6Polyline": {},
"line7Polyline": {},
"line8Polyline": {},
"line9Polyline": {},
"minDetectionConfidence": 75,
"minIntervalBetweenTracks": 5,
"threadCount": 4
}
}
],
"driverClass": "nx::vms::server::plugins::onvif::Resource",
"firmware": "VK1.0.28.2_As",
"forcedMotionDetection": false,
"hasDualStreaming": 1,
"ioSettings": [
{
"autoResetTimeoutMs": 0,
"iDefaultState": "Open Circuit",
"id": "0",
"inputName": "",
"oDefaultState": "Open Circuit",
"outputName": "Output 0",
"portType": "Output",
"supportedPortTypes": "Unknown"
},
{
"autoResetTimeoutMs": 0,
"iDefaultState": "Open Circuit",
"id": "1",
"inputName": "Input 1",
"oDefaultState": "Open Circuit",
"outputName": "",
"portType": "Input",
"supportedPortTypes": "Unknown"
}
],
"isAudioSupported": 1,
"motionStream": "secondary",
"primaryStreamConfiguration": {
"bitrateKbps": 6146,
"codec": "H264",
"fps": 30,
"quality": "undefined",
"resolution": {
"height": 1080,
"width": 1920
}
},
"ptzCapabilities": 16388,
"rtpTransport": "TCP",
"storageInfo": {
"bookmarkStats": {
"recordAverageSizeB": 0,
"recordCount": "0"
},
"lastUpdateTimeMs": "1737525802880",
"motionIndexRecordCount": "3",
"streamStorageInfos": [
{
"archiveIndexRecordCount": "4961",
"archiveSizeB": "85190407428",
"archiveSizeS": "337841"
},
{
"archiveIndexRecordCount": "4927",
"archiveSizeB": "11094036522",
"archiveSizeS": "337935"
}
]
},
"trustCameraTime": 0,
"useMedia2ToFetchProfiles": "useIfSupported",
"usingOnvifMedia2Type": "useIfSupported"
},
"physicalId": "00-0F-0D-2A-F0-08",
"schedule": {
"isEnabled": true,
"maxArchiveDays": -30,
"maxArchivePeriodS": -2592000,
"minArchiveDays": -1,
"minArchivePeriodS": -86400,
"tasks": [
{
"bitrateKbps": 0,
"dayOfWeek": 1,
"endTime": 86400,
"fps": 30,
"metadataTypes": "none",
"recordingType": "always",
"startTime": 0,
"streamQuality": "high"
},
{
"bitrateKbps": 0,
"dayOfWeek": 2,
"endTime": 86400,
"fps": 30,
"metadataTypes": "none",
"recordingType": "always",
"startTime": 0,
"streamQuality": "high"
},
{
"bitrateKbps": 0,
"dayOfWeek": 3,
"endTime": 86400,
"fps": 30,
"metadataTypes": "none",
"recordingType": "always",
"startTime": 0,
"streamQuality": "high"
},
{
"bitrateKbps": 0,
"dayOfWeek": 4,
"endTime": 86400,
"fps": 30,
"metadataTypes": "none",
"recordingType": "always",
"startTime": 0,
"streamQuality": "high"
},
{
"bitrateKbps": 0,
"dayOfWeek": 5,
"endTime": 86400,
"fps": 30,
"metadataTypes": "none",
"recordingType": "always",
"startTime": 0,
"streamQuality": "high"
},
{
"bitrateKbps": 0,
"dayOfWeek": 6,
"endTime": 86400,
"fps": 30,
"metadataTypes": "none",
"recordingType": "always",
"startTime": 0,
"streamQuality": "high"
},
{
"bitrateKbps": 0,
"dayOfWeek": 7,
"endTime": 86400,
"fps": 30,
"metadataTypes": "none",
"recordingType": "always",
"startTime": 0,
"streamQuality": "high"
}
]
},
"serverId": "{3159f676-e4d1-febc-56b6-089567aa3b9f}",
"status": "Recording",
"streamUrls": {
"1": "rtsp://192.168.92.74:554/",
"2": "rtsp://192.168.92.74:554/v2"
},
"typeId": "{9a55ee6b-a595-5807-a5ba-d4aff697dc12}",
"url": "http://192.168.92.74:80/onvif/device_service",
"userEnabledAnalyticsEngineIds": [],
"vendor": "Asoni"
}
-
Hi wilson wang,
Please refer to this article: Using the VMS PTZ API.The 422 error occurs because the camera does not support the requested feature. Before proceeding, please review the article above and check the PTZ functionalities of your devices, particularly the “ptzCapabilities” field (e.g., "ptzCapabilities": 16388).
The value 16388 in ptzCapabilities corresponds to:
• RelativeZoomCapability (16384)
• ContinuousZoomCapability (4)Since absolute positioning is not listed, the device does not support retrieving its position via this API endpoint. This is a limitation of the camera unfortunately.
Thanks.
0
Please sign in to leave a comment.
Comments
1 comment