Hello,
I’m currently looking into setting up an API that my company can use internally for getting recorded video bits from Milestone.
I am however have some issues figuring out what would be the best way to go around it.
I was informed that the Protocol integration would be the best way to go around it, but I’ve having some issues getting the TVPViewerSample to work and I was wondering if anyone here ad some ideas and/or help in directing me the right way.
As for getting the TCPViewerSample working I’ve getting the current error when attempting to connect, but I’ve been unable to find any answer as to what a fix could look like.
“FaultException: The message could not be processed because the action ‘http://videoos.net/2/XProtectCSServerCommand/IServerCommandService/RegisterIntegration’ is invalid or unrecognized.”
It sounds like you are using an old version of XProtect. Could you please let us know which version you are testing with? Also if it is an older version, you can just skip the call to RegisterIntegration.
Thansk for the quick answer, but I’m assming you’re right. I tried what you mentioned and got it working with the live feed, so I assume that XProtect VMS 2020 R1 (20.1.1), would be an old version?
I am sadly not currently getting any recorded playback, only the live feed. From my understanding, we’re recordining everything, so I’d assume I’d be able to go back into the recording.
Everything is relative, but the RegisterIntegration was added in 2020 R3 so in that regard 2020 R1 is old. 
If live is working playback should also work. If you are recording 24-7 I am actually a bit in doubt whether that would be shown as a sequence in the sample (as it is never completed). Do you have any camera which is only recording on motion or otherwise not the entire time you can try out with?
Yeah, from my understanding we do record 24/7, granted. I’m not the IT Admin dealing with it, but I’m fairly certain we would be.
I figured that 24/7 recording likely wouldn’t be shown as sequences, but I haven’t quite been able to figure out what I’d have to call to get a video bit based on start and end timestamp.
In relation to your last question, I don’t believe we have any motions activated cameras or I might just not have access to them.
EDIT: Turns out I lied :-o I’ve been sat staring at my Smart Client for a little now and I see that when there is no movement on a camera, the red recording icons turn green and just says “Showing live feed” instead of “Recording” so I am assuming it smaking recordings? But for whatever reason, they are not showing up on the playback list
Hi again,
Sounds indeed like you are not recording 24-7. If you go to the Playback tab in the Smart Client are you then seeing gaps in the recording indications on the timeline at the bottom of the screen? If so you should definitely have recording sequences available.
If this is the case could you please post a screenshot of the sample application when in Playback mode?
Hello again, yeah. Turns out they’ve never actually given me enough permissions, ie I only had Read permissions. So now I can see the playback.
and I’ve had time to realise that creating an API for getting recorded video within a certain timeframe isen’t just as easys as first figured without needing to export the data first using the export component.
Can’t it even be done using the Protocol integration?
We don’t have a protocol specifically for exports, but our export component uses the normal playback interface for getting out the frames. Of course after that there is quite some work in storing it in the right format, and if you want to have it stored in the XProtect database format there is no way around using our components. In that case the easiest would probably be to make a service that runs on the VMS machine, exposing your API and doing the export.
Is there a Protocol for getting a certain part of a recorded video, based on given start and end times?
Not directly, but bur playback protocol allows you to go to a specific start time and then get frame-by-frame, so doing that you will just have to keep requesting until you get to a desired end time. But be aware that you are handling the frames yourself.
From what I’ve seen on the TCPViewer sample, dosen’t it just get the avaliable playbacks or are we able to fully decide where to take from our selves?
Hmh. Which way would you say would be the better way around it, if I want to setup an API that can get video from the Milestone VMS and some frontend code can then show on a web page f.eks.
I can’t for the life of me, figure out if the code used in the TCPViewerSample, with individual images or the Export Component is the way to go.
Since the component seems to be bound to a Login Dialog that I can’t get around, but the TCP Viewer only returns images.
Components are not bound to a login dialog - that is just the sample using that. We have methods for logging in from non-UI as well.
But if what you want to achieve is playing video on a web page I think you should have a look at the Mobile SDK API exposed by our Mobile Server. It is intended for web usage as well: https://doc.developer.milestonesys.com/mipsdkmobile/
Alternatively you can look into our WebRtc support, but that is currently only a pre-release (and requires 2022 R3 of XProtect): https://doc.developer.milestonesys.com/html/index.html?base=samples/protocolsamples/webrtc_javascript/readme.html&tree=tree_3.html
Regarding this part:
“Components are not bound to a login dialog - that is just the sample using that. We have methods for logging in from non-UI as well.”
Could you point me in the right direction for logging in without using the UI, thats used in the sample.
Aswell as getting a list of camera or a specific camera if able.
Login can be seen in this sample: https://doc.developer.milestonesys.com/html/index.html?base=samples/componentsamples/audiodemo/readme.html&tree=tree_2.html
As to getting a camera you should look at the Configuration.Instance.GetItem* methods. They can either return a specific item if you have the FQID or they can return a tree structure which you then traverse to find all cameras matching the request.
It asks for the sequence information (where do we have recorded video), but when you click on one of those intervals it will use the API to go to the specific time as I describe above.