Tutorial 3 – Adding Bookmarks

Requirements:
Tutorial 2 – Getting Camera Information


In the previous tutorial, we learned how to get information about cameras in the system.

In this tutorial, we’ll learn how to add a Bookmark to the Ocularis Base. First, let’s describe what a Bookmark actually is. Conceptually, a Bookmark is a set of video segments across one or more cameras for a certain time. Bookmarks are stored on the Base and persist even if the recorded video for those segments are purged.

Let’s set up a few accessors:

As noted above, the Base acts as our BookmarkServer, and that is reflected above.

Next, let’s define our Bookmark Classification.

Classifications are user-defined ways to categorize Bookmarks. Classifications are stored in the Base.
In the above, we get the list of supported Classifications from the Base and choose one. All Bookmarks must include a valid Classification.

Let’s continue:

An optional Comment can be added to a Bookmark like the above.

Now, let’s define the time range for our Bookmark:

The times are all in UTC. Above, we add the optional Occurred time, which is meant to indicate at what time the Bookmark was created.

We’ll use the optional tag field for later use during Bookmark deletion:

You can add a list of Tags to each Bookmark. In our case we’ll only need one.

With our Bookmark parameters set up, let’s create a Bookmark and add all of our above values:

We use IBookmarkServer’s NewBookmark method to create a Bookmark object for us and then add the values to its fields.

After Bookmark creation, we’ll need to create a BookmarkFile. A BookmarkFile represents a single camera for the Bookmark; a Bookmark comprises of one or more of the following:

Let’s set up a BookmarkFile’s creation parameters. First, we define the LiveURL for the BookmarkFile:

It’s simply just the LiveURL of the camera.

Next, we define an optional Thumbnail for the BookmarkFile:

//@TODO
In our case, we’ll just blank it out.

Now, we’ll define a Label for the BookmarkFile:

The Label is optional, and can be used to distinguish BookmarkFiles from one another. We’ll just set it to the camera’s name, using ICamera’s GetDisplayName method.

After setting up the parameters, we’ll create the BookmarkFile:

Using IBookmark’s NewBookmarkFile method, we create the BookmarkFile, then add our values to its fields.

Finally, we add the BookmarkFile to the Bookmark, and then send the Bookmark to the BookmarkServer:

Screenshot of the final program:
Series-7-Tutorial-3

That’s about it. You can now create a Bookmark and store it on the BookmarkServer.


Next:
Tutorial 4 – Getting Bookmarks