How do I detect motion when using RawVideoSource?

I have created a small tool based on the “Raw video source retriever” sample from the SDK.

I am using it to detect gaps in the recorded video. But, really I am looking to detect gaps only when there was motion detected.

So, for example, if a camera is configured to record video only every 5 seconds when there is no motion detected, I am not too concerned about that. However, if there is a gap of 5 seconds when there IS motion present, than I am concerned about that.

My tool is working pretty good except for those cameras which regularly have gaps like this. When there is no motion.

Does anyone have an idea how I can determined when motion is present in the raw video?

Surely this information is recorded somewhere as Smart Client shows red on the timeline when there is motion. I just have not figured out how to find that information and map it to the time as I scan through the raw video data.

XProtect keeps information about when motion was detected. The information can be retrieved using a SequenceDataSource class.

https://doc.developer.milestonesys.com/html/index.html?base=miphelp/class_video_o_s_1_1_platform_1_1_data_1_1_sequence_data_source.html&tree=tree_search.html?search=sequencedatasource

The motion sequence is the one that tells you when there was motion detected.

https://doc.developer.milestonesys.com/html/index.html?base=miphelp/class_video_o_s_1_1_platform_1_1_data_1_1_data_type_1_1_sequence_type_guids.html&tree=tree_search.html?search=sequencetype

I suggest you explore the Sequence Viewer plugin sample where you can see it in use.

https://doc.developer.milestonesys.com/html/index.html?base=samples/pluginsamples/scsequenceviewer/readme.html&tree=tree_1.html

https://github.com/milestonesys

Thanks for the suggestion Bo.

I will check it out.

Kevin Glick
App-Techs Corporation
505 Willow Lane
Lancaster, PA 17601
(717) 735-0848 x113

Thinking about it, another SequenceDataSource gives you when there is recording and no recording. If you trust that data you might not need to inspect the data using the RawVideoSource, this is only a thought based on your description, whether the presence of this SequenceDataSource makes a difference to your project is up to you.

This is exactly what I was looking for Bo.

Thanks!