specifications have a significant level of complexity
by themselves. This scenario applies to both service
provider and consumer development, and our
experience in using cameras from manufacturers not
involved in ONVIF specifications shows that they
are still making progress towards full support. We
address the difficulties of developing applications
that are clients of video cameras, called Network
Video Transmitters (NVT) in ONVIF, namely by
means of a library.
In the literature, there are few works involving
ONVIF. The more focused ones (Senst et al., 2011);
(Yi-Hsing et al., 2011) describe parts of ONVIF and
particular applications. They do not address the
difficulties of implementing an ONVIF library that
provides generic functionality to help to develop
NVT client applications. To our knowledge, ONVIF
Device Manager (Synesis, 2013) has the only non-
proprietary library available. It is an open source C#
library to manage NVT devices that comes with a
demo application. However, its API mirrors ONVIF
operations, not offering a higher-level API easier to
use. Additionally, industrial applications seek to
increase efficiency, to raise competitiveness and
mark a position on markets. So, computational
performance and resource usage is very important
and non-interpreted programing languages have
advantages in this matter.
This paper introduces a C library supporting the
development of NVT clients. The library was
developed for an industry partner that integrates IP
cameras to produce a complete line of surveillance
equipment. The main contributions are (1) the
library design and (2) an API that is much simpler
than a direct reflection of ONVIF commands, (3)
without affecting flexibility. More specifically, this
is achieved by taking advantage of several
opportunities, namely (4) abstract useless details, (5)
make use of context, (6) provide higher-level
functionalities, and (7) normalize some ONVIF
aspects. We demonstrate how the library reduces the
complexity by exemplifying how it supports the
implementation of operations and features that
present more challenges to developers.
In the next section ONVIF is briefly introduced,
and its relevance for control and automation systems
based on video is explained. The library architecture
is explained in section 3. In section 4 we describe
the API of Device Discovery module. The paper
ends with sections 5 and 6 which respectively
summarize the results and conclusions.
2 ONVIF OVERVIEW
ONVIF functions are defined as SOAP operations.
Core specification (ONVIF, 2012), contextualizes
the usage of WS-Discovery, WS-Security (OASIS,
2012a) and WS-BaseNotification, and defines
Device Management (DM) and Event services.
Other specifications define a single service. Besides
NVTs, ONVIF devices are classified in types – NV
Display, NV Storage and NV Analytics – for which
a set of mandatory (M), mandatory if the device has
a related feature (C), and optional (O) services are
defined. A NVT device has the following set of
services: M = {Device Management, Event, Media,
Streaming, Device IO}, C = {PTZ}, and O =
{Imaging, Video Analytics}.
Services’ operations are protected by user
authentication and a security policy. Authentication
credentials should be provided at either the
transport-level (HTTP), using Digest Access
Authentication (IETF, 1999), or the message-level
(SOAP), using any token profile defined by WS-
Security. Servers shall at least support the WS-
Security UsernameToken Profile (OASIS, 2012b),
which requires clients to send the username of an
existing account and respective password digest.
ONVIF enables the development of automation
systems based on NVTs, wherein the controller is a
client. The input of such systems can be both video
and digital inputs, and the control can be made
through NVT relay outputs or any other devices. The
detection of actuation scenarios can be made by
processing video streams at either ONVIF clients or
NVTs supporting the optional Video Analytics
service. NVT’s inputs sensing and outputs command
is made through the mandatory Device IO service.
Asynchronous real-time control can be implemented
by using the Event service. This service enables the
subscription of input and Video Analytics events
that, when detected by NVTs, are automatically sent
to the client controller (using Basic Notification
Interface (OASIS, 2012a); (ONVIF, 2012). Events
can also be received on request (using Real-time
Pull-point Notification Interface (ONVIF, 2012) and
through metadata streaming (Notification Streaming
Interface (ONVIF, 2012).
3 LIBRARY DESIGN
UMOC is a C library that provides functions to
manage ONVIF NVT devices. Figure 1 introduces
the library, showing how it is built and its
ICINCO2013-10thInternationalConferenceonInformaticsinControl,AutomationandRobotics
410