We are using Milestone’s directShow filter to get live and playback uncompressed frames to our application. The problem we have is with the frame’s timestamp. The difference between two consecutive frames is always 200000 and it does not match the time of the frame. This happens for both live and playback streams. We also tested with the DirectShowHelloMilestone_C++ sample application and the behavior is the same. How can we get the correct frame time?
Milestone recommend using Multimedia Toolkit (C++ or C#) instead of the directshow filter.
When you observe this behavior what is the URL you are using?
(Perhaps you should be using “Userealtime=1”)
We are not using Userealtime=1. I’ll try it and give you feedback.
For live video we are using:
MilestoneDX://IP:PORT?username=USER&password=PASSWORD&cameraid=CAMID&authtype=0&timeout_connect=5
For recorded video we have:
MilestoneDX://IP:PORT?username=USER&password=PASSWORD&cameraid=CAMID&authtype=0&starttime=START&speed=1&timeout_connect=5
I tried adding the parameter Userealtime=1 to the URL but the result is the same
Oops. This is case sensitive. (Sorry, the upper-case is a mistake on my part.)
Please retry using userealtime=1
No problem. I tried again with userealtime=1 and the result is the same.
Sorry for the rather uncertain answers on this. It has been a while since we last visited the DirectShow filter.
I have done a bit of testing plus investigated the code and turns out that the userealtime parameter is not the right answer after all (as you also found out).
In order to get the correct time stamp for a given frame you should instead look at its media time as we set that to the absolute time of the frame (we are using IMediaSample::SetMediaTime to do this).