Hey
I’m looking for plugin example to stop or start recording all the cameras
Note: when the record is in stop I’m still need to be able to run playback
Thanks
Hey
I’m looking for plugin example to stop or start recording all the cameras
Note: when the record is in stop I’m still need to be able to run playback
Thanks
I suggest you create a rule that when a user-defined event is triggered you begin recording on all cameras belonging to a group (and uses another event to stop).
You then develop a plugin that trigger the user-defined events on UI button or other criteria you implement.
As inspiration for the plugin explore the ConfigAccessViaSDK sample; the Trigger button. This is not a plugin sample but you can use the same code in your plugin.
It is important to note that a rule can start and stop recording, but if another rule or user action has started recording you cannot stop the recording by applying a rule.
Much like: https://developer.milestonesys.com/s/article/About-start-and-stop-recording-in-MIP-SDK-c-library
Thank you
I take a look on ConfigAccessViaSDK example and I see that in the example using send massage TriggerCommand but not using Stat/StopRecordingCommand massage so I don’t understand how they in the example control on the recording
also I want to know if there is any way to go overall the Camera and the Screen Recorder in the systems so I can send for each one of them Stop or Start record massage
Allow me to explain.
You said you wanted to start all the cameras. What I suggest is that you create a rule that will start and stop recording in all cameras. This is an alternative to sending StartRecordingCommand to each camera which could be many depending on the size of your installation.
If you do not know how to create the rule please consult the help (F1) in the Management Client, or ask again.
You can see how to use the StartRecordingCommand if you explore the VideoViewer sample. https://doc.developer.milestonesys.com/html/index.html?base=samples/videoviewer_sample.html&tree=tree_2.html
As you indicate this would be the way to go if you want control of the individual camera and not all cameras in on go.
Hey
Thank you!
by you recommended if prefer to create a rule
So I try to take a look on ConfigAccessViaSDK example
first I don’t exactly understand what the meaning of ConfigAccessViaSDK application so maybe it’s will be easy to find what in need from the example if I understand what the application do - so I will be happy to get a little explain
Second I will like to get more explain or reference to explain about ‘rule’, how I create rule that effect from outside ? (in may case I using socket massage UDP)
So the ConfigAccessViaSDK does a lot of stuff but the Trigger button in that sample is the method that I wanted you to notice. The Trigger button will, if you have a user-defined event picked, trigger the user-defined event.
The central code you need to use (and you do not need much else) is: (item being the user-defined event)
EnvironmentManager.Instance.SendMessage(
new VideoOS.Platform.Messaging.Message(
VideoOS.Platform.Messaging.MessageId.Control.TriggerCommand), item.FQID);
I am glad I had the chance to explain further, do not hesitate to ask again if it does not play for you right away..
OK
and how I create a rule ?
Thank you
hey
I try to create a rule from the XProtect Management Client application
But it’s look like something wrong
When I try to klick on each rule in the list (was in the rule list some building rules) the XProtect Management Client application crash…
this is the error details :
File format is nit valid
************** Exception Text **************
Exception source: System.Windows.Forms
Exception type: System.ArgumentException
Exception message: File format is not valid.
Exception target site: StreamIn
at System.Windows.Forms.RichTextBox.StreamIn(Stream data, Int32 flags)
at System.Windows.Forms.RichTextBox.StreamIn(String str, Int32 flags)
at System.Windows.Forms.RichTextBox.set_Rtf(String value)
at System.Windows.Forms.RichTextBox.OnHandleCreated(EventArgs e)
at System.Windows.Forms.Control.WmCreate(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.RichTextBox.WndProc(Message& m)
at VideoOS.Administration.Controls.RichTextBoxEx.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** System Info **************
Date and Time: 22/09/2020 14:28:37
Machine Name: DESKTOP-B7NRPQ7
IP address: fe80::5c20:db17:53c0:3edf%6 (DESKTOP-B7NRPQ7)
Current User: DESKTOP-B7NRPQ7\JFST1
Thank you
the like to fix the crash was very useful
I don’t find to create rule from kind ‘StartRecordingEvnt’ in the list of the rule
where I can find that rule ?
You need to create the events and the rule in the Management Client
I believe this can be of guidance..
Hey
I try to create my Event (from 3 type in the list : ‘User-defined Event’ ‘Analytics Event’ ‘Generic Event’) in all of themes in ‘Step 2: Conditions’ I don’t find options to add ‘start recording immediately on RecordOnRuleCamerasGroup’
I have only the options : ‘Within selected time’ Outside selected time in’ ‘Within the time period’ ‘Day of week is’ ‘Event is from’
Can you help me?
Thank you
Hey
I found, I just skip on that step…
Thank you!
Hey
So I chose to use ‘User-defined Events’ - I understand that that event base on string
Now I’m try to send the Event from my XProtect Smart Client plugin
how I can send my specific User-defined Event ?
If you have the Item that is your user-defined event you just use it.
Note that the ConfigAccesViaSDK should be an eye opener to the “configuration” and how it is structured, so you might revisit that sample.
If you do not have the Item, you find it, I suggest you look at the CameraStreamResolution sample, FindCamera method, but change it to use Kind.TriggerEvent instead of a Kind.Camera
Alternatively use VideoOS.Platform.Configuration.GetItemsBySearch
So I try to create an item with two way (GetItemsByKind and GetItemsBySearch)
List<Item> list = Configuration.Instance.GetItemsByKind(Kind.TriggerEvent);
SearchResult Result;
List<Item> list1 = Configuration.Instance.GetItemsBySearch("UDEventStopRecord", 10, 10, out Result);
In the both of them I don’t find my event in the lists…
The two samples I have mentioned both illustrate that the configuration is like a tree, so you probably miss using the GetChildren method when you use GetItemsByKind.
The ConfigAccessViaSDK builds a tree to visualize this, the FindCamera method implements a very simple recursive routine that can help.
However the GetItemsBySearch method should give you a common list so your list1 should contain the Item in the list.
might be better yet.. https://developer.milestonesys.com/s/question/0D53X00006Sow5dSAB/how-to-get-the-available-cameras
hey
I try to copy that get item samples
"SearchResult result;
List listCam = Configuration.Instance.GetItemsByKind(Kind.Camera);
List list2 = Configuration.Instance.GetItemsByKind(Kind.TriggerEvent);
List list1 = Configuration.Instance.GetItemsBySearch(“UDEventStopRecord”, 10, 10, out result);
List allUserDefinedEvents = Configuration.Instance.GetItemsBySearch(Kind.TriggerEvent.ToString(), 10, 5, out result);"
Into CameraStreamResolution example , in FindCamera method
and all of them work good
but in my plugin it’s not working at all
It’s look like the Configuration.Instance not working well
In CameraStreamResolution example the Configuration.Instance.ServerName member is ‘DESKTOP-B7NRPQ7’ (as the host name)
But in my plugin Configuration.Instance.ServerName member is empty
Did I miss something in the initialization of Configuration or something else ?
Thank you!