Skip to content

ONVIF ​

References: ONVIF Core Specification 26.06, Media Service Specification 24.12, PTZ Service Specification 25.12 and Imaging Service Specification 18.12. ONVIF lets these documents be redistributed unchanged, so copies are included here:

DocumentCopyOfficial source
Core 26.06PDFonvif.org
Media 24.12PDFonvif.org
PTZ Service 25.12PDFonvif.org
Imaging 18.12PDFonvif.org

The copies are © ONVIF™ and come with ONVIF's copyright notice, licence and disclaimer, which are on page 2 of each PDF. They are not modified. The MIT licence of ptzsim does not cover them.

ptzsim module: ptzsim/onvif.py, option --onvif [PORT] (SOAP 1.2 over HTTP, default port 8080).

Core: transport, errors, security ​

SectionRequirementptzsim
Core 5.8.2SOAP 1.2 faults with the subcode chains ter:…yes; env:Sender faults use HTTP 400 and env:Receiver faults use HTTP 500
Core 5.8.2.4HTTP errorsmethods other than GET/POST get 405
Core 5.9.1HTTP digest authentication (RFC 2617), 401 with a challengeyes (--onvif-user, --onvif-auth digest)
Core 5.9.5WS-Security UsernameToken, PasswordDigest and PasswordTextyes (--onvif-auth wsse)
Core 5.9.4.4some calls work before authenticationGetSystemDateAndTime, GetCapabilities, GetServices, GetServiceCapabilities, GetWsdlUrl, GetHostname, GetEndpointReference
Core 5.9.3SHA-256 digestmissing (MD5 only)
—HTTPSmissing (issue #33)

Core: discovery (chapter 7) ​

SectionRequirementptzsim
Core 7.3.1stable endpoint reference (urn:uuid:)yes, derived from the camera name
Core 7.3.2Hello on start, with types, scopes and XAddrsyes, Types dn:NetworkVideoTransmitter tds:Device, AppSequence
Core 7.3.3Probe/ProbeMatch, matched by type and scope (rfc3986, strcmp0)yes
Core 7.3.4Resolve/ResolveMatchyes
Core 7.3.5Bye when leavingyes, on exit
Core 7.2, 8.3.18–19discovery mode discoverable/non-discoverableyes, GetDiscoveryMode/SetDiscoveryMode

Core: device management (chapter 8) ​

SectionOperationptzsim
8.1.1GetWsdlUrlyes
8.1.2.2–8.1.2.4GetServices, GetServiceCapabilities, GetCapabilitiesyes (device, media, PTZ, imaging)
8.2.1–8.2.2GetHostname, SetHostnameyes
8.2.4–8.2.15GetDNS, GetNTP, GetNetworkInterfaces, GetNetworkProtocols, GetNetworkDefaultGateway and their Set operationsGet answers with the current values; Set is accepted but not simulated
8.3.1GetDeviceInformationyes
8.3.6–8.3.8Get/SetSystemDateAndTime, SetSystemFactoryDefaultGet yes; Set accepted, not simulated
8.3.13SystemRebootaccepted, not simulated
8.3.14–8.3.17GetScopes, SetScopes, AddScopes, RemoveScopesyes; fixed scopes cannot be removed (ter:OperationProhibited/ter:FixedScope)
8.4.3GetUsersyes; Create/Delete/SetUser missing
—Events servicemissing (issue #30)

Media service ​

SectionOperationptzsim
5.2.2–5.2.3GetProfiles, GetProfileone profile Profile_1 with video source, encoder and PTZ configuration
5.2.5, 5.2.8, 5.2.14, 5.2.17Add/Remove video source, video encoder and PTZ configurationyes; without the PTZ configuration, PTZ calls fail with ter:NoPTZProfile
5.3.1GetVideoSourcesVideoSource_1, 640×360, 25 fps
5.4.1–5.4.5video source configuration operationsyes
5.5.1–5.5.6video encoder configuration operations, GetGuaranteedNumberOfVideoEncoderInstancesyes (H.264)
5.15.1GetStreamUrireturns --rtsp-uri; ptzsim does not stream (issue #35)
5.16.1GetSnapshotUrimissing, SnapshotUri="false"
5.21GetServiceCapabilitiesyes

PTZ service ​

SectionOperation / requirementptzsim
5.1GetNodes, GetNode (ter:NoEntity)node PTZNode_1 with the generic spaces, 100 presets, home support
5.2GetConfigurations, GetConfiguration, GetConfigurationOptions, SetConfiguration, GetCompatibleConfigurationsyes; SetConfiguration accepts the known token but changes nothing
5.3all move commands are non-blockingyes
5.3.1AbsoluteMove: ter:InvalidPosition, ter:SpaceNotSupported, ter:InvalidSpeed; an omitted axis keeps its motionyes; --onvif-no-absolute simulates a node without absolute spaces
5.3.2RelativeMove: ter:InvalidTranslation; a target past the end stops is clipped at the borderyes
5.3.3ContinuousMove: Timeout overrides DefaultPTZTimeout (PT5S), ter:TimeoutNotSupported outside PT0.1S–PT60S, ter:InvalidVelocity; velocity 0 stops an axis, an omitted axis keeps movingyes
5.3.5Stop with PanTilt/Zoom flags, both default to trueyes
5.3.7GetStatus: position in the default spaces, MoveStatus IDLE/MOVING, UtcTimeyes
5.4.1SetPreset: new preset without a token, update with an existing token (ter:NoToken otherwise), ter:MovingPTZ, ter:TooManyPresetsyes
5.4.2–5.4.4GetPresets, GotoPreset (Speed, ter:NoToken), RemovePresetyes
5.5.1–5.5.2GotoHomePosition (with Speed), SetHomePositionyes; the home position can be overwritten (FixedHomePosition="false")
5.6auxiliary commandsmissing
5.8preset toursmissing
5.3.4, 5.3.6GeoMove, MoveAndStartTrackingmissing (optional)
5.7generic spaces: position, translation, velocity −1…1 (zoom position 0…1), speed 0…1yes; no other spaces are offered

Imaging service ​

SectionOperationptzsim
5.1.2–5.1.4GetImagingSettings, SetImagingSettings, GetOptionswhite balance only: mode AUTO/MANUAL, Cr/Cb gains 0…255 (128 = VISCA 0x80)
5.3.1–5.3.4Move, GetMoveOptions, Stop, GetImagingStatusfocus: Move with Absolute (position 0…1), Relative (distance −1…1) or Continuous (speed −1…1) turns autofocus off and drives the focus axis; Stop halts it; GetStatus returns position 0…1 and IDLE/MOVING; GetMoveOptions advertises all three kinds. Out-of-range values give ter:InvalidArgVal; 0 = infinity, 1 = closest (VISCA 0x1000…0xF000)
5.2imaging presetsmissing

A PTZ camera simulator for testing camera integrations. Released under the MIT License.