ONVIF AbsoluteMove: send the speed in a named speed space, at its maximum #23

Merged
ClaudeAI merged 1 commits from fix/onvif-abs-move-speed into master 37 minutes ago
Collaborator

Summary

protocolPTZ_ONVIF::goAbsolute moved the camera slower than a preset move. The AbsoluteMove request sent its speed as <Speed><PanTilt x="1" y="1"/><Zoom x="1"/></Speed>, without a space attribute. A camera then reads the value in its own default speed space (the one of the PTZConfiguration's DefaultPTZSpeed), where 1 isn't necessarily the maximum. It may even be the slowest setting, for example in a range of 0..300 degrees per second. Preset moves usually run at the camera's own preset speed instead.

Changes

  • pOnvif::ptz_GetNode():
    • parses SupportedPTZSpaces and keeps the PanTiltSpeedSpace / ZoomSpeedSpace to use: the generic one if the node lists it, otherwise the first one with its own XRange;
    • if GetNode fails, the generic spaces (GenericSpeedSpace / ZoomGenericSpeedSpace, range 0..1) are used;
    • the debug printf of the whole reply is removed.
  • ptz_AbsoluteMove(): sends the speed with the space attribute, at that space's maximum. An optional speed argument (0..1 of the range) is available.
  • protocolPTZ_ONVIF::create(): reads the node's speed spaces once and logs which speed is used, for example PTZ speed (from node): PanTilt ...GenericSpeedSpace max 1.000, Zoom ... max 1.000.
  • Parsing note: XMLNode::nChildNode(name) compares the prefixed name (tt:...), but getChildNode(name, i) ignores the prefix, so the spaces are iterated with getChildNode until it returns an empty node.

Testing

Fake ONVIF camera, protocol test with AddressSanitizer (no findings):

Camera offers AbsoluteMove sends
Generic speed space (plus a vendor one listed first) 1.0, generic space named
Only a vendor space (0..300 / 0..7) 300 and 7, in the vendor space
No speed spaces (GetNode not supported) 1.0, generic space
  • The la_mojo Debug86 build is fine. The only error is videoLive555AVLibSource.cpp:818, which comes from the newer live555 headers used for the check (std::atomic<char> event-loop flag), not from this change.
  • Not tested on a real camera.

If the moves are still slow

The cause is then probably a camera setting. Many PTZ cameras reduce the pan speed when zoomed in ("Proportional Pan"). An ABS move includes a zoom target, so it is affected, while presets are not. The new log line shows which speed the camera is offered.

Generated with Claude Code

https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16

## Summary `protocolPTZ_ONVIF::goAbsolute` moved the camera slower than a preset move. The AbsoluteMove request sent its speed as `<Speed><PanTilt x="1" y="1"/><Zoom x="1"/></Speed>`, without a `space` attribute. A camera then reads the value in its own default speed space (the one of the PTZConfiguration's DefaultPTZSpeed), where 1 isn't necessarily the maximum. It may even be the slowest setting, for example in a range of 0..300 degrees per second. Preset moves usually run at the camera's own preset speed instead. ### Changes - **`pOnvif::ptz_GetNode()`:** - parses `SupportedPTZSpaces` and keeps the `PanTiltSpeedSpace` / `ZoomSpeedSpace` to use: the generic one if the node lists it, otherwise the first one with its own `XRange`; - if GetNode fails, the generic spaces (`GenericSpeedSpace` / `ZoomGenericSpeedSpace`, range 0..1) are used; - the debug `printf` of the whole reply is removed. - **`ptz_AbsoluteMove()`:** sends the speed with the `space` attribute, at that space's maximum. An optional speed argument (0..1 of the range) is available. - **`protocolPTZ_ONVIF::create()`:** reads the node's speed spaces once and logs which speed is used, for example `PTZ speed (from node): PanTilt ...GenericSpeedSpace max 1.000, Zoom ... max 1.000`. - **Parsing note:** `XMLNode::nChildNode(name)` compares the prefixed name (`tt:...`), but `getChildNode(name, i)` ignores the prefix, so the spaces are iterated with `getChildNode` until it returns an empty node. ## Testing Fake ONVIF camera, protocol test with AddressSanitizer (no findings): | Camera offers | AbsoluteMove sends | |---|---| | Generic speed space (plus a vendor one listed first) | 1.0, generic space named | | Only a vendor space (0..300 / 0..7) | 300 and 7, in the vendor space | | No speed spaces (GetNode not supported) | 1.0, generic space | - The la_mojo `Debug86` build is fine. The only error is `videoLive555AVLibSource.cpp:818`, which comes from the newer live555 headers used for the check (`std::atomic<char>` event-loop flag), not from this change. - **Not tested on a real camera.** ## If the moves are still slow The cause is then probably a camera setting. Many PTZ cameras reduce the pan speed when zoomed in ("Proportional Pan"). An ABS move includes a zoom target, so it is affected, while presets are not. The new log line shows which speed the camera is offered. Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0139veDo3XyavMuVhdnHcN16
ClaudeAI added 1 commit 40 minutes ago
c9fdfd9702
ONVIF AbsoluteMove: send the speed in a named speed space, at its maximum
ClaudeAI merged commit 8e345e6161 into master 37 minutes ago
The pull request has been merged as 8e345e6161.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.