ONVIF protocol

I have an ESP32 CAM with RTSP video output. My NVR does not allow direct entry of RTSP address, it only detects address from ONVIF protocol. Is it possible to implement basic ONVIF protocol on ESP32?
Thanks

Perhaps you can explain what RTSP, NVR and ONVIF mean ?

...R

Robin2:
Perhaps you can explain what RTSP, NVR and ONVIF mean ?

...R

RTSP - Real Time Streaming Protocol - stream with video from the camera

At least now I know that I can't help. And it does not seem as if your questions are "Arduino" questions.

Keep in mind that the ESP8266 and the ESP32 are not Arduino products. People have just hijacked the Arduino IDE to make an easy-to-use platform for programming them.

I suspect a Forum that deals with video streams and video recording would be more likely to have an answer. Or a Forum that deals with ESP devices such as the ESP8266 Forum (I know it has some ESP32 stuff).

...R

Is it possible to implement basic ONVIF protocol on ESP32?

Yes. Packets sent over the network.

jremington:
Yes. Packets sent over the network.

Can you please explain it?

If you are planning to implement a standard protocol, in all cases you must obtain and carefully study the official protocol specifications.

If you wish to share the code you write, it should conform to those specifications.

I am in the same boat as you @davida3

I have a few ESP32 cameras and have RTSP/JPG streaming working but now looking onto the ONVIF part. In the process of having a look around to see if anyone else has already solved this before I have a crack at it.

I was thinking that as the ONVIF interface looks to be a simple web interface that servers up a configuration interface, most importantly the URI of the RTSP stream so it should not be too hard to just mock up.
For testing I was going to see if I could just dump/clone the Onvif from a device and then just rehost it updating only a few values like steam URI and see if that works (may not even have to be on the same device).

I did have a concern that my NVR my not support the device as the stream is JPG encoded instead of h.264

I also want to use the ONVIF protocol over Wifi for the TTGO T-Camera ESP32 OV2640 to be used together with open source project www.OpenPNP.org (Open pick'n'place machine)

gr0b:
I was thinking that as the ONVIF interface looks to be a simple web interface that servers up a configuration interface, most importantly the URI of the RTSP stream so it should not be too hard to just mock up.

It's actually a SOAP endpoint, so think plenty of XML sadly. That said, there do seem to be a few SOAP libraries for various purposes but I don't know how hard it would be to make them work for ONVIF purposes. There's a number of requests that get made to identify the device, figure out its capabilities, work out the resolution and then get the endpoint for video.

Of the requests I've looked at, they all seem to be a POST request to /onvif/device_service with some details of what the request is for. There is some documentation, but I don't know how minimal an implementation you can get away with. The GetStreamUri provides the details of a requested stream, based on the information that was previously provided (there's a number of requests preceding this example). I've pretty printed a response below to a GetStreamUri request:

<?xml version="1.0" encoding="UTF-8"?>
<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:chan="http://schemas.microsoft.com/ws/2005/02/duplex" xmlns:wsa5="http://www.w3.org/2005/08/addressing" 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:wsc="http://schemas.xmlsoap.org/ws/2005/02/sc" 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:ns2="http://www.onvif.org/ver10/pacs" xmlns:xmime="http://tempuri.org/xmime.xsd" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsrfbf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsrfr="http://docs.oasis-open.org/wsrf/r-2" xmlns:ns1="http://www.onvif.org/ver10/accesscontrol/wsdl" xmlns:ns3="http://www.onvif.org/ver10/actionengine/wsdl" xmlns:tad="http://www.onvif.org/ver10/analyticsdevice/wsdl" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:trc="http://www.onvif.org/ver10/recording/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:trv="http://www.onvif.org/ver10/receiver/wsdl" xmlns:tse="http://www.onvif.org/ver10/search/wsdl" xmlns:vifsvr="http://www.onvif.org/ver10/events/wsdl/PullPointSubscriptionBinding" xmlns:vifsvr10="http://www.onvif.org/ver20/analytics/wsdl/AnalyticsEngineBinding" xmlns:vifsvr2="http://www.onvif.org/ver10/events/wsdl/EventBinding" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:vifsvr3="http://www.onvif.org/ver10/events/wsdl/SubscriptionManagerBinding" xmlns:vifsvr4="http://www.onvif.org/ver10/events/wsdl/NotificationProducerBinding" xmlns:vifsvr5="http://www.onvif.org/ver10/events/wsdl/NotificationConsumerBinding" xmlns:vifsvr6="http://www.onvif.org/ver10/events/wsdl/PullPointBinding" xmlns:vifsvr7="http://www.onvif.org/ver10/events/wsdl/CreatePullPointBinding" xmlns:vifsvr8="http://www.onvif.org/ver10/events/wsdl/PausableSubscriptionManagerBinding" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:vifsvr9="http://www.onvif.org/ver20/analytics/wsdl/RuleEngineBinding" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:tns1="http://www.onvif.org/ver10/topics">
	<SOAP-ENV:Header>
		<wsa5:Action SOAP-ENV:mustUnderstand="true">http://www.onvif.org/ver10/media/wsdl/GetStreamUri</wsa5:Action>
	</SOAP-ENV:Header>
	<SOAP-ENV:Body>
		<trt:GetStreamUriResponse>
			<trt:MediaUri>
				<tt:Uri>rtsp://1.2.3.4:554/live/ch0</tt:Uri>
				<tt:InvalidAfterConnect>false</tt:InvalidAfterConnect>
				<tt:InvalidAfterReboot>false</tt:InvalidAfterReboot>
				<tt:Timeout>PT0H50M0S</tt:Timeout>
			</trt:MediaUri>
		</trt:GetStreamUriResponse>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>