timestamp of each frame from Onvif bridge server or protocol integration

A external LPR server wants to get video frames from Milestone Xprotect.

Because the LPR server is not wrote by .Net, it seems possible to get live frames from Xprotect by imageserver protocol, mobile protocol or Onvif bridge integrations.

Is it possible to get the timestamp of each frame via each integration?

Which integration is suggested to get live frames & timestamps accordingly.

We are considering the time sync issue that the timestamp info may be shifted because of transcoding.

Best regards,

Allen

Image Server

Yes, you will get time stamps. What you get is described in the GenericByteData format: https://doc.developer.milestonesys.com/html/index.html?base=mipgenericbytedata/main.html&tree=tree_3.html

Mobile

In the Mobile server protocol there is a field called TimeStampUtc (in ms).

It represents the actual timestamp of the Transcoded video frame.

If however Direct Streaming is used, the field represents the timestamp of the first video frame of the following mp4 fragment.

Other timestamps in the fragmented file should be reconstructed from the timestamp of the first frame and relative timestamp increase in the MP4 file.

In all the cases I would not recommend to be implemented LPR integration trough the Mobile server.

It has limited performance and could not handle large amount of video streams, especially in high resolution and transcoding.

DS in other hand introduces another layer of complexity forcing the client to understand structure of the MP4 files.

ONVIF Bridge

In the RTSP server (of the ONVIF Bridge) video frame timestamp could be reconstructed from the RTP packet timestamp and RTSP sender report correspondence.

Every RTP packet has a RTP timestamp, which is in 90 kHz units.

From time to time (for sure once after the first RTP video frame is sent) RTSP server sends RTCP sender report packet.

It contains correspondence between RTP time and NTP time.

This NTP time is the actual video frame timestamp for this particular RTP time.

So for every next RTP video frame the actual NTP timestamp is calculated from the RTP timestamp and the difference with the last RTP timestamp for which was received RTCP sender report with NTP timestamp.

This is also described in this question:

https://developer.milestonesys.com/s/question/0D53X00006tSt04SAC/when-getting-video-streaming-from-onvif-bridge-for-video-anlaytics-does-it-support-to-get-the-time-information-from-the-frame-the-lpr-system-is-getting-video-streaming-thru-onvif-bridge-and-they-system-needs-to-know-the-time-information-of-frame

If the you aim to integrate toward the ONVIF Bridge, it is better to be used TCP as underlying transport. Otherwise, in case of UDP, it could lose frames. ONVIF Bridge has better performance as it doesn’t do any transcoding and could handle easily more 100 video streams. It however works only with H.264 cameras.

If I remember well by reconstruction of the actual frame time from the NTP timestamp (low and high 32 bits) have to be used rounding in order to not be loosed accuracy.

Hi Hi Milestone team,

Because some cameras in the project are older and don’t support H.264, Onvif bridge cannot be used in this situation. The integration will go via protocol integration.

https://doc.milestonesys.com/sysarch/pdf/2019r3/en-US/MilestoneONVIFBridge_GettingStartedGuide_en-US.pdf

(Onvif bridge needs camera supporting H.264 in extraction on page-6)

In the GenericByteData, there are two timestamps, ‘Time stamp (Sync)’, ‘Time stamp (Picture)’.

https://doc.developer.milestonesys.com/html/MIPGenericByteData/video_sub_formats.html

What is the definition of the timestamp?

  1. The time stamp is the time that cameras send out the frames.
  2. The time that milestone server receive the frames.
  3. The time that milestone image server send out the frames.

Best regards,

Allen

Hi Allen,

the Time stamp (Picture) should be the time stamp that is set by the camera when we have received the image on the RecordingServer. once we have stored the timestamp it is never altered. So it is either provided in the stream by the camera, or if this is old device that can not provide the timestamp we will use the time when an image is received on RecordingServer, in both cases the image time is afte that not altered. it is always stored in UTC format.

Kind regards,

Artur.

hi Artur,

Thanks for the reply, very clear.

How about Time stamp(Sync)?

The definition of Time stamp(Sync) is the time that milestone image server send out the frames, right?

Best regards,

Allen

Hi Allen,

No, this is the timestamp of the nearest syncpoint (key frame) of the stream. This value should be constant within a GOP and change when next GOP starts.

kind regards,

Artur.