ONVIF
lastmod 2024-10-14created 2017-01-2440 edits
ONVIF is an open industry forum for the development of a global standard for the interface of IP-based physical security products.
Profiles
- ONVIF:ProfileA - Profile A for broader access control configuration
- ONVIF:ProfileC - Profile C for IP-based access control systems
- ONVIF:ProfileG - Profile G for edge storage and recording
- ONVIF:ProfileQ
- ONVIF:ProfileS - Profile S for streaming video
- ONVIF:ProfileT - Profile T for advanced video streaming
- ONVIF:ProfileM - Profile M for metadata of analytics applications
ONVIF Device Manager
- ONVIF Device Manager (ODM)
- Xeoma
- Shinobi
- Zoneminder
- Shinobi CE: (GPLv3 + AGPLv3) Shinobi is the Open Source CCTV Solution written in Node.JS. Designed with multiple account system, Streams by WebSocket, and Save to WebM. Shinobi can record IP Cameras and Local Cameras.
- Revere
Examples
- Genivia - gSOAP ONVIF Examples (gSOAP)
- ONVIF:Example:FindDevice - How to find and communicate with cameras on the network using ONVIF
- ONVIF:Example:Client - A simple command-line client using zeep.
Libraries
- zeep - Highly recommended for Python!
- libONVIF Yet another ONVIF library
- agsh/onvif - ONVIF node.js implementation
ONVIF Application Programmer's Guide
WSDL Spec
The WSDL specs for ONVIF can be downloaded from the following sites.
Authentication using wsse
Authentication methods for requests and what to do when one fails:
- Include <UsernameToken> in the SOAP Header of the HTTP Body, using a plain-text password.
- In this case,
#PasswordTextis appended to the end of the Type attribute URI of <wsse:Password>.
- In this case,
- In this case,
#PasswordDigestis appended to the end of the Type attribute URI of <wsse:Password>. (See [Programmer's Guide] for the encoding method)- For example: <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">
...</wsse:Password>
- For example: <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">
- In this case, the password used in <UsernameToken> must be a Digest.
Actual request packet:
POST /onvif/device_service HTTP/1.1
Host: 192.168.0.202
User-Agent: UserAgentFS
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 749
Authorization: Digest username="admin", realm="iPolis", nonce="399190d0cef9db75b7bd", uri="/onvif/device_service", response="59b44e9a2b4b1a8f35a7267eb062cc3a", opaque="dda4084c", qop=auth, nc=00000001, cnonce="19b0d833"
<?xml version="1.0" ?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Header xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Security>
<wsse:UsernameToken>
<wsse:Username>admin</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">iZq+wmgOB3ixwTA/EvXEgQRtWwM=</wsse:Password>
<wsse:Nonce>Mzg4NTg0NDY1MDQyNzE5MA==</wsse:Nonce>
<wsu:Created>2000-08-09T17:11:43Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</s:Header>
<s:Body xmlns:tds="http://www.onvif.org/ver10/device/wsdl">
<tds:GetDeviceInformation/>
</s:Body>
</s:Envelope>
Actual response packet:
HTTP/1.1 200 OK
Set-Cookie: TRACKID=b6b576ae163c45dd4cb8de0c3042d541; Secure; HttpOnly
Server: gSOAP/2.8
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 3329
Connection: close
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Date: Wed, 09 Aug 2000 17:11:44 GMT
<?xml version="1.0" ?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"
xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:c14n="http://www.w3.org/2001/10/xml-exc-c14n#"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsa5="http://www.w3.org/2005/08/addressing"
xmlns:xmime="http://tempuri.org/xmime.xsd"
xmlns:xop="http://www.w3.org/2004/08/xop/include"
xmlns:fc="http://www.onvif.org/ver20/analytics/humanface"
xmlns:bd="http://www.onvif.org/ver20/analytics/humanbody"
xmlns:ttr="http://www.onvif.org/ver20/analytics/radiometry"
xmlns:axt="http://www.onvif.org/ver20/analytics"
xmlns:tt="http://www.onvif.org/ver10/schema"
xmlns:wsrf-bf="http://docs.oasis-open.org/wsrf/bf-2"
xmlns:wstop="http://docs.oasis-open.org/wsn/t-1"
xmlns:wsrf-r="http://docs.oasis-open.org/wsrf/r-2"
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
xmlns:axt3="http://www.onvif.org/ver20/analytics/wsdl/RuleEngineBinding"
xmlns:axt4="http://www.onvif.org/ver20/analytics/wsdl/AnalyticsEngineBinding"
xmlns:axt2="http://www.onvif.org/ver20/analytics/wsdl"
xmlns:tds="http://www.onvif.org/ver10/device/wsdl"
xmlns:tev1="http://www.onvif.org/ver10/events/wsdl/NotificationProducerBinding"
xmlns:tev2="http://www.onvif.org/ver10/events/wsdl/EventBinding"
xmlns:tev3="http://www.onvif.org/ver10/events/wsdl/SubscriptionManagerBinding"
xmlns:tev="http://www.onvif.org/ver10/events/wsdl"
xmlns:tev4="http://www.onvif.org/ver10/events/wsdl/PullPointSubscriptionBinding"
xmlns:tev5="http://www.onvif.org/ver10/events/wsdl/NotificationConsumerBinding"
xmlns:tev6="http://www.onvif.org/ver10/events/wsdl/PullPointBinding"
xmlns:tev7="http://www.onvif.org/ver10/events/wsdl/CreatePullPointBinding"
xmlns:tev8="http://www.onvif.org/ver10/events/wsdl/PausableSubscriptionManagerBinding"
xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2"
xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl"
xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl"
xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl"
xmlns:tpv="http://www.onvif.org/ver10/provisioning/wsdl"
xmlns:tr2="http://www.onvif.org/ver20/media/wsdl"
xmlns:trc="http://www.onvif.org/ver10/recording/wsdl"
xmlns:trp="http://www.onvif.org/ver10/replay/wsdl"
xmlns:trt="http://www.onvif.org/ver10/media/wsdl"
xmlns:tse="http://www.onvif.org/ver10/search/wsdl"
xmlns:tth="http://www.onvif.org/ver10/thermal/wsdl"
xmlns:tns1="http://www.onvif.org/ver10/topics"
xmlns:ter="http://www.onvif.org/ver10/error"
xmlns:env="http://www.w3.org/2001/12/soap-envelope"
xmlns:tnssamsung="http://www.samsungcctv.com/2011/event/topics"
>
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<tds:GetDeviceInformationResponse>
<tds:Manufacturer>Samsung Techwin</tds:Manufacturer>
<tds:Model>XNP-9300RW</tds:Model>
<tds:FirmwareVersion>2.01.07_20220429_R440</tds:FirmwareVersion>
<tds:SerialNumber>ZS5F6V4TC0000QZ</tds:SerialNumber>
<tds:HardwareId>XNP-9300RW</tds:HardwareId>
</tds:GetDeviceInformationResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
How to scan
- ethernet - Find IP address from a IP-Camera (Ubuntu) - Super User
- You can use nmap.
- The official way is to use WS-Discovery.
If the camera is configured to obtain it's address via DHCP, and you plug it into your network. You could run nmap on your ubuntu box to scan the network. There are a myriad of options to nmap - but you could try something like:
Obviously, change the ip range to suit your network. namp will attempt to figure out what OS is running on each of the IPs it finds, so you should be able to work out what one the camera is.
Another answer
Use nmap to find all devices with RTSP (port 554) streams (replace IP range with your network's applicable IPs):
Look in /proc/net/arp to see any applicable IPs for MAC address you know:
Use brute force with nmap to find the stream URLs (replace 10.0.0.198 with whatever you found in previous command):
See also
- PSIA
- onvifcpplib
- CCTV
- python-onvif
- python-onvif-zeep
- Web Services Description Language (WSDL)
- Web Services Dynamic Discovery (WS-Discovery)
Favorite site
- ONVIF web site
- [Recommended] ONVIF 2.0 Service Operation Index
- ONVIF (Korean reading: onbipeu), SOAP, and Web Services 3
- ONVIF Application Programmer's Guide (PDF) 4
- ONVIF™ Core Specification (PDF)
- [Recommended] ONVIF (Korean reading: onbipeu), SOAP, and Web Services 5 (ONVIF, SOAP)
References
- Closed-circuit television
- Devicemgmt.wsdl
- Digital video recorder
- Media Streaming
- Media.wsdl
- Network Video Recorder
- Nmap
- ONVIF:Example:Client
- ONVIF:Example:FindDevice
- ONVIF:ProfileA
- ONVIF:ProfileC
- ONVIF:ProfileG
- ONVIF:ProfileM
- ONVIF:ProfileS
- ONVIF:ProfileT
- Port scanner
- Power over Ethernet
- Python-onvif
- Python-onvif-zeep
- Python:Libraries
- Shinobi
- Simple Object Access Protocol
- SolutionStack:FullStackDeveloper:Curriculum
- Video management system
- Web Services Description Language
- Web Services Dynamic Discovery
- Xeoma
- Zeep