How do I force VMS clients to use RTSP/TCP instead of HTTP in ONVIF GetStreamUri? What StreamingCapabilities must I set in GetProfiles to prevent HTTP protocol requests?

I’m developing a custom ONVIF camera service in C# that streams via MediaMTX which is an RTSP-only server. When Milestone XProtect VMS connects to my service, it successfully discovers the camera and retrieves profiles, but when requesting the stream URI through GetStreamUri, it specifically asks for Protocol equals HTTP in the StreamSetup Transport element. MediaMTX only supports RTSP on port 8554, RTSPS which is RTSP over TLS, and HLS for HTTP Live Streaming, but it does NOT support RTSP-over-HTTP tunneling. I’ve tried returning SOAP Faults to reject HTTP protocol requests, but the problem is that C#'s XmlSerializer doesn’t easily support ONVIF-compliant fault subcodes like ter:InvalidArgVal or ter:NoProfile without complex manual XML construction. Without proper nested subcodes, the fault response is non-compliant and XProtect either rejects it or doesn’t gracefully fall back to RTSP. What I need is to configure my ONVIF service proactively so that XProtect never requests HTTP protocol in the first place. Specifically, what StreamingCapabilities should I set in my GetProfiles response? What XML elements or attributes are required to signal that only RTSP/TCP transport is available? How do I ensure VMS clients like XProtect understand from the profile capabilities that only RTSP transport is supported? My goal is to force XProtect to request Protocol equals RTSP or RTP-RTSP-TCP from the beginning, completely eliminating the need for fault handling. Currently my GetProfiles response includes basic profile information with VideoEncoderConfiguration showing H264 encoding and 1920x1080 resolution, but I’m missing the proper Extension element with StreamingCapabilities. Should I set RTP_TCP to true, RTP_RTSP_TCP to true, and RTPMulticast to false? Are there other profile elements that influence the VMS client’s protocol selection behavior?

Here are the Logs of my ONVIF Service

These are the ONVIF Logs of the Recording Server

Did you check this? - https://doc.milestonesys.com/latest/en-us/onvifdriver/https.htm?tocpath=Third-party%20integrations%7CONVIF%C2%AE%20drivers%7CDriver%20settings%7C_____3

Does that mean, that the ONVIF Driver only supports RTSP over HTTP and nothing else? Because the RTSP Server i am using (MediaMTX) does not support HTTP Tunneling. Is there no way for me to use RTSP over UDP/TDP?

I have asked Milestone Development expert developers (drivers) to see and respond to this thread.

RTP/RTSP/TCP transport if indicated by the RTP_RTSP_TCP capability - see https://www.onvif.org/specs/srv/media/ONVIF-Media2-Service-Spec.pdf section: 5.13

In GetServicesResponse, media service should have Capabilities like the following:

This is my GetServicesResponse, it looks just like the one you send me, did i do it wrong somewhere?

<s:Envelope xmlns:s=“http://www.w3.org/2003/05/soap-envelope” xmlns:xsd=“http://www.w3.org/2001/XMLSchema” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”>

<s:Body>

    <GetServicesResponse xmlns="[http://www.onvif.org/ver10/device/wsdl](http://www.onvif.org/ver10/device/wsdl)">

        <Service>

            <Namespace>[http://www.onvif.org/ver10/device/wsdl</Namespace>](http://www.onvif.org/ver10/device/wsdl%3C/Namespace%3E)

            <XAddr>[http://192.168.50.50:5050/onvif/device\_service</XAddr>](http://192.168.50.50:5050/onvif/device_service%3C/XAddr%3E)

            <Version>

                <Major xmlns="[http://www.onvif.org/ver10/schema](http://www.onvif.org/ver10/schema)">2</Major>

                <Minor xmlns="[http://www.onvif.org/ver10/schema](http://www.onvif.org/ver10/schema)">5</Minor>

            </Version>

            <Capabilities>

                <Capabilities>

                    <Network xmlns="[http://www.onvif.org/ver10/schema](http://www.onvif.org/ver10/schema)">

                        <IPFilter>false</IPFilter>

                        <ZeroConfiguration>false</ZeroConfiguration>

                        <IPVersion6>false</IPVersion6>

                        <DynDNS>false</DynDNS>

                    </Network>

                    <Security xmlns="[http://www.onvif.org/ver10/schema](http://www.onvif.org/ver10/schema)">

                        <TLS1.1>false</TLS1.1>

                        <TLS1.2>false</TLS1.2>

                        <OnboardKeyGeneration>false</OnboardKeyGeneration>

                        <AccessPolicyConfig>false</AccessPolicyConfig>

                        <X.509Token>false</X.509Token>

                        <SAMLToken>false</SAMLToken>

                        <KerberosToken>false</KerberosToken>

                        <RELToken>false</RELToken>

                    </Security>

                    <System xmlns="[http://www.onvif.org/ver10/schema](http://www.onvif.org/ver10/schema)">

                        <DiscoveryResolve>true</DiscoveryResolve>

                        <DiscoveryBye>true</DiscoveryBye>

                        <RemoteDiscovery>false</RemoteDiscovery>

                        <SystemBackup>false</SystemBackup>

                        <SystemLogging>false</SystemLogging>

                        <FirmwareUpgrade>false</FirmwareUpgrade>

                        <SupportedVersions>

                            <Version>

                                <Major>2</Major>

                                <Minor>5</Minor>

                            </Version>

                        </SupportedVersions>

                    </System>

                </Capabilities>

            </Capabilities>

        </Service>

        <Service>

            <Namespace>[http://www.onvif.org/ver10/media/wsdl</Namespace>](http://www.onvif.org/ver10/media/wsdl%3C/Namespace%3E)

            <XAddr>[http://192.168.50.50:5050/onvif/media\_service</XAddr>](http://192.168.50.50:5050/onvif/media_service%3C/XAddr%3E)

            <Version>

                <Major xmlns="[http://www.onvif.org/ver10/schema](http://www.onvif.org/ver10/schema)">2</Major>

                <Minor xmlns="[http://www.onvif.org/ver10/schema](http://www.onvif.org/ver10/schema)">5</Minor>

            </Version>

            <Capabilities>

                <Capabilities>

                    <StreamingCapabilities RTPMulticast="false" RTP\_TCP="true" RTP\_RTSP\_TCP="true" NonAggregateControl="false" NoRTSPStreaming="false" xmlns="[http://www.onvif.org/ver10/schema](http://www.onvif.org/ver10/schema)" />

                </Capabilities>

            </Capabilities>

        </Service>

    </GetServicesResponse>

</s:Body>

</s:Envelope>

We received Wireshark traces and driver logs trough support. You have general problems with ONVIF implementation. You response are not created according ONVIF specifications. The structure is wrong, there are missing or wrong namespaces and many other problems. For instance the GetServicesResponse from previous comment. You have nested capability tags:

<StreamingCapabilities … />

It should be:

<StreamingCapabilities ... />

This is the reason for the error message you see “Error: Protocol=‘Protocol_RTP_UDP’ does not exist, using ‘Protocol_RTP_RTSP_HTTP_TCP’ instead”. We are not able to read the list of streaming capablities you support an d we default to RTSP on HTTP. We also never reach to the point to ask for the URL for streaming and actually try to stream because you don’t support GetVideoEncoderConfigurationOptions. You respond with internal server error.

imageYou probably have other thing to fix before we reach that point.

So here are links to the Onvif specification where you can find information:

Specification - https://www.onvif.org/specs/srv/media/ONVIF-Media-Service-Spec.pdf?utm_source=chatgpt.com

Version 10 meria WSDL - https://www.onvif.org/ver10/media/wsdl/media.wsdl?utm_source=chatgpt.com

ONVIF schema root - https://www.onvif.org/onvif/ver10/schema/onvif.xsd

Use these resources to fix issues and test with the Device Test tool to see if there are more.

Hi, first of all, thank you for your response. The emulator I’m building is designed to handle a specific use case for now, which means it does not yet require a full, comprehensive ONVIF implementation. My initial focus was on responding to all Device Discovery queries from Siveillance, so that the emulator would be recognized and accepted as a device - this part is working as intended, though some errors inevitably remain.

Regarding the GetServicesResponse:

You’re right, the Capabilities element should not be nested twice - I originally implemented it that way based on a screenshot shared earlier in this thread. However, as shown in the documentation image I attached, within the Capabilities element, the child elements are simply named Device, Media, etc., with their types and not names set as DeviceCapabilities, MediaCapabilities, and so forth. This discrepancy has left me somewhat confused.

What’s even more puzzling are the official instructions for the Service object, which state:

“The placeholder for the service capabilities. The service capability element shall be returned here. For example for the device service that would be the tds:DeviceServiceCapabilities element (not complextype).”

This wording suggests that the capability element should be named DeviceServiceCapabilities, or by analogy, MediaServiceCapabilities for the media service. However, I haven’t been able to find documentation that confirms this naming convention for MediaServiceCapabilities.

Hi, I understand your confusion implementing Onvif standard is complex thing. But it will be difficult to sue to help you based on the information provided. If you reached the point were we trying to get video from your emulator(even on Http) this communication is not present in the Wireshark trace provided from you. I don’t see the GetUrl request and the attempt to stream video. Please provide Wireshark trace with that communication and the log so we can analyze it. It will be event belter if you can provide public IP for your emulator so we can connect and test it.

Hello,

I have reworked the SOAP messages in my ONVIF implementation, but I am still experiencing issues with the Siveillance VMS integration. Please note that my emulator does not yet cover the complete ONVIF specification, but it does implement the most essential commands required for basic functionality. Interestingly, the ONVIF Device Manager (ODM) works perfectly and all operations, including GetStreamUri, are executed successfully. However, Siveillance VMS no longer requests GetStreamUri, which is particularly strange since it did request it in earlier tests. I can successfully add the emulator as a device in Siveillance VMS and the camera profile is correctly recognized, including resolution, transport protocol, and other parameters. However, when I select the profile, nothing happens and no stream request is initiated. I have implemented empty responses for GetMetadataConfigurations, GetAudioEncoderConfigurations, and GetAudioSourceConfigurations, and verified that all responses comply with the ONVIF Media Service specifications. I have prepared Wireshark packet captures and Siveillance VMS driver logs for analysis, but unfortunately the forum does not allow me to upload them. This is because I am considered a new user since the forum was renewed, and additionally the forum does not permit trace file uploads in general. Please let me know how I can share these files with you for further investigation. Could you please help me identify why Siveillance VMS stops the process before requesting GetStreamUri, even though the same implementation works correctly with ODM?

Thank you for your assistance.

Best regards

Hi,

I’ve now also tested with the HappyTime Multiple ONVIF Emulator. I configured the VMS to use the Media1 Service, and the same issue occurs - GetStreamUri is not being requested in the trace, exactly like with my own emulator. I also tested with Media2, but the result is the same. I have saved all the traces from both tests, but I’m not sure where I can upload them for you to review.

Could you please let me know where I should share these trace files?

Best regards