Best Way to Ingest Out-of-Order TS Files into Milestone (Profile G or Alternatives?)

Hi everyone,

We’re developing a custom integration with Milestone XProtect and would appreciate guidance on how best to implement a non-traditional ingest workflow.

Context:

Our server continuously receives

.ts

files (3 seconds each, containing H.264 video and AAC audio). However, these files may arrive out of order — we might receive a segment recorded at time

X

, followed by one recorded at

X - 100 days

. There is no real-time/live stream: all data is delayed and unpredictable in arrival order.

Goal:

We want to ingest each

.ts

file into Milestone as soon as it is received on our server, regardless of its timestamp or sequence.

Current Approach:

We’ve implemented a virtual ONVIF Profile G-compatible camera to expose the stored video segments. However, we are facing the following issues:

  1. RTSP Requirement: Milestone requires a live RTSP stream to initialize the camera. Since we don’t have a real-time stream, we’ve created a fake RTSP endpoint just to satisfy this requirement. Is there a way to bypass this or indicate that the device is “archive-only”?
  2. Edge Storage Not Queried Unless RTSP Breaks: Milestone only queries the edge storage (via ONVIF G) when the RTSP connection is interrupted and then re-established. We would like Milestone to continuously request data from edge storage, regardless of the RTSP stream’s connection state.
  3. Request Time Range Too Limited: When requesting archived footage via GetMediaAttributes, Milestone always starts from the last timestamp known before the RTSP connection was interrupted. However, we need it to request all available video that has not yet been ingested, without being limited by any prior session’s last-seen timestamp. Is there a way to change this behavior, perhaps through settings in XProtect Management Client (we’re on 2023 R3)?

Question:

Is simulating a Profile G ONVIF camera really the best approach for our scenario? Or would it be better to use a different mechanism, such as the MIP SDK (e.g., implementing a Media Gateway or a custom Recording Server plugin)? We’d like to follow the most compatible and robust path with Milestone’s architecture.

Any insights, suggestions, or references would be greatly appreciated!

Thanks in advance,

Milestone Development has noted this question and will be answering later.

Hi Gabriele Palmieri,

First, here is some information about the issues you have:

1)RTSP Requirement: We actually request replay stream from the camera not live but this is probably also not working for you.

2)Edge Storage Not Queried Unless RTSP Breaks: The logic behind our Edge storage implementation is that when device is added to our product it records the live video when there is connection to the device. When connection is interrupted for some reason there will be gaps that we try to fill by requesting the video from the device. There could be many gaps and we are trying to fil them all consecutively. This is about the automatic edge retrieval.

3)Request Time Range Too Limited: You can also manually or with rule(see Rules in Management Client) trigger recording retrieval of missing part of the video. The only limitation of the requested period is that we can’t retrieve video for the period before adding the device to our product.

I think the best best option for you is to use MIP SDK because you problem is too complex and needs custom solution. We don’s support “archive-only” device types. Or “continuously request data from edge” but for which period of time? We can’t ask for all videos all the time it will be time and resource consuming. As I mentioned you can try by creating a rule for that and call it on certain periods of time but I’m not sure it will work in the best way for you. That’s why probably the best option is to use MIP SDK and make custom solution. Here you can find example how to start remote retrieval from device with MIP SDK and a lot more useful information:

https://doc.developer.milestonesys.com/html/index.html?base=samples%2Fcomponentsamples%2Fremoteretrievaltasksample%2Freadme.html&tree=tree_2.html

Regards,