ONVIF Wrong Stream URI

I’m creating a test ONVIF server (profile G & S) but I’m having some issues getting the live stream from a camera to show.

I’m running my test ONVIF server on the same machine where XProtect is installed, and I have a camera (with its own RTSP streaming server) streaming in the same network.

I implemented the ONVIF GetStreamUri method, and it’s returning Uri=“rtsp:///stream1”. Using VLC Player I can see the stream with any issues.

However, the stream is not showing in XProtect. According to Wireshark, my ONVIF server is returning the correct uri, but XProtect is concatenating the ONVIF server IP with the camera stream name - “rtsp:///stream1” - when it’s making the RTSP describe call.

How can I fix this issue?

Dear Partner,

your question is received and will be scheduled for investigation accordingly. We will answer to you as soon as possible.

Best Regards!

Any news on this?

Dear Alaa Abouzeid,

After reviewing the issue, it appears that the URL you are providing to XProtect is not fully correct, which is causing your camera to be rejected.

Let me explain the issue in more detail.

From the attached Wireshark trace, it is clear that some key information is missing. Specifically, in the GetStreamUri request, the driver requires a profile token to assign the stream. By default, it uses the first token (in your case, ProfileToken_1), but in the provided GetStreamUriResponse, this token is missed.

While VLC can stream your video successfully because it does not require tokens or additional stream details, XProtect needs this additional information to function correctly.

To clarify, below are examples of responses from other devices that include the correct GetStreamUriResponse:

// Hanwha

// Cannon

As you can see both of them, specify their token in the rtsp_stream_link.

In order to define the correct profile_token, you have to use the same variables as described in the GetProfileResponse. In your case, I see you have only one profile_token:

Additionally, you can see from the picture below, that multiple attempts are made to send the same request: “GetStreamUri“, with an expectation of receiving the correct format in the response. After a timeout, we have just stopped.

To resolve this, please ensure you provide the correct rtsp_streaming_link with the appropriate profile token as described in the GetProfileResponse.

Another issue may come from not having Onvif specifiers, provided in the tags. Here, in order to explain it better, please refer to the images below.

// picture from our camera

// picture from your camera

As you can see, the difference is that there is tr2: specifier in the correct format, but in the provided wireshark trace it is missed.

// GetVideoSourcesResponse from our camera

// GetVideoSourcesResponse from your camera

Here is missed tmd specifier.

I saw in other requests you have missed specifiers as well. In order to resolve the issue with the right specifiers, I will leave a link below for the Milestone ONVIF documentation where you can find the needed information to resolve the issue. Also, other problems may emerge on the way of diving into the document.

Link to the Milestone ONVIF Documentation: Version 1.22 / December 2023 - Milestone ONVIF drivers (milestonesys.com), where you can find more information regarding different profiles.

Please feel free to reach out if you need further clarification or assistance in adjusting your setup.

Best regards,

Genadi