<?xml version="1.0"?>
<?xml-stylesheet href="docbook.xsl" type="text/xsl" ?>
<book xmlns="http://docbook.org/ns/docbook" version="5.0">
  <info>
    <title>Media2 Service Specification</title>
    <titleabbrev>Media2</titleabbrev>
    <releaseinfo>25.06</releaseinfo>
    <author>
      <orgname>ONVIF™</orgname>
      <uri>www.onvif.org</uri>
    </author>
    <pubdate>June, 2025</pubdate>
    <mediaobject>
      <imageobject>
        <imagedata fileref="media/logo.png" contentwidth="60mm"/>
      </imageobject>
    </mediaobject>
    <copyright>
      <year>2008-2025</year>
      <holder>ONVIF™ All rights reserved.</holder>
    </copyright>
    <legalnotice>
      <para>Recipients of this document may copy, distribute, publish, or display this document so
        long as this copyright notice, license and disclaimer are retained with all copies of the
        document. No license is granted to modify this document.</para>
      <para>THIS DOCUMENT IS PROVIDED "AS IS," AND THE CORPORATION AND ITS MEMBERS AND THEIR
        AFFILIATES, MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT
        LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
        NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THIS DOCUMENT ARE SUITABLE FOR ANY PURPOSE;
        OR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY PATENTS, COPYRIGHTS,
        TRADEMARKS OR OTHER RIGHTS.</para>
      <para>IN NO EVENT WILL THE CORPORATION OR ITS MEMBERS OR THEIR AFFILIATES BE LIABLE FOR ANY
        DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, ARISING OUT OF OR
        RELATING TO ANY USE OR DISTRIBUTION OF THIS DOCUMENT, WHETHER OR NOT (1) THE CORPORATION,
        MEMBERS OR THEIR AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR (2)
        SUCH DAMAGES WERE REASONABLY FORESEEABLE, AND ARISING OUT OF OR RELATING TO ANY USE OR
        DISTRIBUTION OF THIS DOCUMENT.  THE FOREGOING DISCLAIMER AND LIMITATION ON LIABILITY DO NOT
        APPLY TO, INVALIDATE, OR LIMIT REPRESENTATIONS AND WARRANTIES MADE BY THE MEMBERS AND THEIR
        RESPECTIVE AFFILIATES TO THE CORPORATION AND OTHER MEMBERS IN CERTAIN WRITTEN POLICIES OF
        THE CORPORATION.</para>
    </legalnotice>
    <revhistory>
      <revision>
        <revnumber>1.0</revnumber>
        <date>Dec-2015</date>
        <author>
          <personname>Hans Busch</personname>
        </author>
        <revremark>First release</revremark>
      </revision>
      <revision>
        <revnumber>1.01</revnumber>
        <date>Mar-2016</date>
        <author>
          <personname>Hans Busch</personname>
        </author>
        <revremark>CR 1767, 1819</revremark>
      </revision>
      <revision>
        <revnumber>16.06</revnumber>
        <date>Jun-2016</date>
        <author>
          <personname>Hiroyuki Sano</personname>
        </author>
        <revremark>CR 1786, 1795, 1799, 1801, 1819, 1861, 1869</revremark>
      </revision>
      <revision>
        <revnumber>16.12</revnumber>
        <date>Dec-2016</date>
        <author>
          <personname>Sujith Raman</personname>
        </author>
        <author>
          <personname>Steve Dillingham</personname>
        </author>
        <author>
          <personname>Hans Busch</personname>
        </author>
        <author>
          <personname>Hiroyuki Sano</personname>
        </author>
        <revremark>Added RTSP over WebSocket Added Scene Orientation Modes Added Privacy Mask CR
          1873, 1875, 1931, 1951, 1983, 1986</revremark>
      </revision>
      <revision>
        <revnumber>17.06</revnumber>
        <date>Jun-2017</date>
        <author>
          <personname>Hans Busch</personname>
        </author>
        <author>
          <personname>Hiroyuki Sano</personname>
        </author>
        <revremark>Update method layouts. Change Request 1843, 2018, 2037, 2064, 2082,
          2105</revremark>
      </revision>
      <revision>
        <revnumber>17.12</revnumber>
        <date>Dec-2017</date>
        <author>
          <personname>Sujith Raman</personname>
        </author>
        <author>
          <personname>Steve Wolf</personname>
        </author>
        <author>
          <personname>Hiroyuki Sano</personname>
        </author>
        <revremark>Added ViewMode Added OSD Image Upload Change Request 2152, 2159, 2176, 2187,
          2197, 2203, 2207</revremark>
      </revision>
      <revision>
        <revnumber>18.06</revnumber>
        <date>Jun-2018</date>
        <author>
          <personname>Hiroyuki Sano</personname>
        </author>
        <revremark>Change Request 2216, 2217, 2282</revremark>
      </revision>
      <revision>
        <revnumber>18.12</revnumber>
        <date>Dec-2018</date>
        <author>
          <personname>Hiroyuki Sano</personname>
        </author>
        <revremark>Change Request 2295</revremark>
      </revision>
      <revision>
        <revnumber>19.06</revnumber>
        <date>Jun-2019</date>
        <author>
          <personname>Steve Wolf</personname>
        </author>
        <author>
          <personname>Hiroyuki Sano</personname>
        </author>
        <revremark>Added Active Sessions Change Request 2479, 2512</revremark>
      </revision>
      <revision>
        <revnumber>19.12</revnumber>
        <date>Dec-2019</date>
        <author>
          <personname>Hiroyuki Sano</personname>
        </author>
        <author>
          <personname>Dora Han</personname>
        </author>
        <revremark>Change Request 2489, 2557, 2573, 2603, 2636 Added Multitrack
          Streaming</revremark>
      </revision>
      <revision>
        <revnumber>20.06</revnumber>
        <date>Jun-2020</date>
        <author>
          <personname>Michio Hirai</personname>
        </author>
        <revremark>Change Request 2571, 2604</revremark>
      </revision>
      <revision>
        <revnumber>20.12</revnumber>
        <date>Dec-2020</date>
        <author>
          <personname>Hans Busch</personname>
        </author>
        <revremark>Support media service without video encoder.</revremark>
      </revision>
      <revision>
        <revnumber>21.06</revnumber>
        <date>Jun-2021</date>
        <author>
          <personname>Sujith Raman</personname>
        </author>
        <revremark>Clarify system coordinates.</revremark>
      </revision>
      <revision>
        <revnumber>21.12</revnumber>
        <date>Dec-2021</date>
        <author>
          <personname>Hans Busch, Rick Boer</personname>
        </author>
        <revremark>Add optional Receiver configuration to Media2. Fix inconsistency in Media2
          NoProfile fault message.</revremark>
      </revision>
      <revision>
        <revnumber>22.12</revnumber>
        <date>Dec-2022</date>
        <author>
          <personname>Hans Busch</personname>
        </author>
        <revremark>Add secure RTSPS streaming.</revremark>
      </revision>
      <revision>
        <revnumber>23.06</revnumber>
        <date>Jun-2023</date>
        <author>
          <personname>Oksana Tuishkina</personname>
        </author>
        <revremark>Clarify signaling rotation in video source configuration.</revremark>
      </revision>
      <revision>
        <revnumber>24.06</revnumber>
        <date>Jun-2024</date>
        <author>
          <personname>Fredrik Svensson</personname>
        </author>
        <revremark>Add WebRTC configuration.</revremark>
      </revision>
      <revision>
        <revnumber>24.12</revnumber>
        <date>Dec-2024</date>
        <author>
          <personname>Fredrik Svensson, Björn Volker, Jean-François Lévesque</personname>
        </author>
        <revremark>Add media signing. Add recommendation to have LensDescription present when Fisheye view mode is present. </revremark>
      </revision>
      <revision>
        <revnumber>25.06</revnumber>
        <date>Jun-2025</date>
        <author>
          <personname>Venki Aravapalli, Sujith Raman</personname>
        </author>
        <revremark>Add audio clip Management and EQ presets.</revremark>
      </revision>
    </revhistory>
  </info>
  <chapter xml:id="_Toc241999828">
    <title>Scope </title>
    <para>This document defines the second generation web service interface for configuration of the so called media profiles. These include the selection of Video and Audio inputs as well as PTZ and Analytics modes and the configuration of Video and Audio encoders.</para>
    <para>Media streaming is out of scope of this document and covered by the ONVIF streaming specification.</para>
    <para>Web service usage is outside of the scope of this document. Please refer to the ONVIF core specification.</para>
  </chapter>
  <chapter>
    <title>Normative references</title>
    <para>IANA Media Type Reference</para>
    <para role="reference">&lt; <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.iana.org/assignments/media-types/media-types.xhtml"></link>&gt;</para>
    <para>ONVIF Core Specification</para>
    <para role="reference">&lt;<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.onvif.org/onvif/specs/core/ONVIF-Core-Specification.pdf"></link>&gt;</para>
    <para>ONVIF PTZ Service Specification</para>
    <para role="reference">&lt;<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.onvif.org/onvif/specs/srv/ptz/ONVIF-PTZ-Service-Spec.pdf"></link>&gt;</para>
    <para>ONVIF Streaming Specification</para>
    <para role="reference">&lt;<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.onvif.org/onvif/specs/stream/ONVIF-Streaming-Spec.pdf"></link>&gt;</para>
    <para>ONVIF Media Signing Specification</para>
    <para role="reference">&lt;<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.onvif.org/onvif/specs/stream/ONVIF-MediaSigning-Spec.pdf"></link>&gt;</para>
    <para>ONVIF WebRTC Specification</para>
    <para role="reference">&lt;<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.onvif.org/onvif/specs/stream/ONVIF-WebRTC-Spec.pdf"></link>&gt;</para>
    <para>ONVIF Security Service Specification</para>
    <para role="reference">&lt;<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.onvif.org/onvif/specs/stream/ONVIF-Security-Service-Spec.pdf"></link>&gt;</para>
  </chapter>
  <chapter>
    <title>Terms and Definitions</title>
    <section>
      <title>Definitions</title>
      <informaltable>
        <tgroup cols="2">
          <colspec colname="c1" colwidth="24*" />
          <colspec colname="c2" colwidth="76*" />
          <tbody valign="top">
            <row>
              <entry align="left">
                <para>
                  <emphasis role="bold">Configuration Entity</emphasis>
                </para>
              </entry>
              <entry align="left">
                <para>A network video device media abstract component that produces or consumes  a media stream on the network, i.e. video and/or audio stream. </para>
              </entry>
            </row>
            <row>
              <entry align="left">
                <para>
                  <emphasis role="bold">Digital PTZ</emphasis>
                </para>
              </entry>
              <entry align="left">
                <para>Function that diminishes or crops an image to adjust the image position and ratio.</para>
              </entry>
            </row>
            <row>
              <entry valign="middle">
                <para>
                  <emphasis role="bold">GZIP</emphasis>
                </para>
              </entry>
              <entry valign="middle">
                <para>GNU data format for lossless compression.</para>
              </entry>
            </row>
            <row>
              <entry align="left">
                <para>
                  <emphasis role="bold">Media Profile</emphasis>
                </para>
              </entry>
              <entry align="left">
                <para>Maps a video and audio sources and outputs encoders as well as PTZ and analytics configurations.</para>
              </entry>
            </row>
            <row>
              <entry align="left">
                <para>
                  <emphasis role="bold">Metadata</emphasis>
                </para>
              </entry>
              <entry align="left">
                <para>All streaming data except video and audio, including video analytics results, PTZ position data and other <phrase>metadata (such as textual data from POS applications)</phrase>.</para>
              </entry>
            </row>
            <row>
              <entry align="left">
                <para>
                  <emphasis role="bold">Reference Token</emphasis>
                </para>
              </entry>
              <entry align="left">
                <para>Token provided by the device to uniquely reference an instance of a physical IO, configuration or profile.</para>
              </entry>
            </row>
            <row>
              <entry align="left">
                <para>
                  <emphasis role="bold">Video Analytics</emphasis>
                </para>
              </entry>
              <entry align="left">
                <para>Algorithms or programs used to analyze video data and to generate data describing object location and behaviour.</para>
              </entry>
            </row>
          </tbody>
        </tgroup>
      </informaltable>
    </section>
    <section>
      <title>Abbreviations</title>
      <informaltable>
        <tgroup cols="2">
          <colspec colname="c1" colwidth="24*" />
          <colspec colname="c2" colwidth="76*" />
          <tbody valign="top">
            <row>
              <entry valign="middle">
                <para>RTCP</para>
              </entry>
              <entry valign="middle">
                <para>RTP Control Protocol</para>
              </entry>
            </row>
            <row>
              <entry valign="middle">
                <para>RTP</para>
              </entry>
              <entry valign="middle">
                <para>Realtime Transport Protocol</para>
              </entry>
            </row>
            <row>
              <entry valign="middle">
                <para>RTSP</para>
              </entry>
              <entry valign="middle">
                <para>Real Time Streaming Protocol</para>
              </entry>
            </row>
            <row>
              <entry valign="middle">
                <para>TCP</para>
              </entry>
              <entry valign="middle">
                <para>Transmission Control Protocol</para>
              </entry>
            </row>
            <row>
              <entry valign="middle">
                <para>UDP</para>
              </entry>
              <entry valign="middle">
                <para>User Datagram Protocol</para>
              </entry>
            </row>
            <row>
              <entry valign="middle">
                <para>EXI</para>
              </entry>
              <entry valign="middle">
                <para>Efficient XML Interchange Format</para>
              </entry>
            </row>
          </tbody>
        </tgroup>
      </informaltable>
    </section>
  </chapter>
  <chapter>
    <title>Overview</title>
    <para>Media configurations are handled through the media service. Media configurations are used to determine the streaming properties of requested media streams as defined in this specification. The device provides media configuration through the media service. WSDL for this service is specified in <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.onvif.org/ver20/media/wsdl/media.wsdl">http://www.onvif.org/ver20/media/wsdl/media.wsdl</link>l.</para>
    <table>
      <title>Referenced namespaces (with prefix)</title>
      <tgroup cols="2">
        <colspec colname="c1" colwidth="13*" />
        <colspec colname="c2" colwidth="87*" />
        <thead>
          <row>
            <entry>
              <para>Prefix</para>
            </entry>
            <entry>
              <para>Namespace URI</para>
            </entry>
          </row>
        </thead>
        <tbody valign="top">
          <row>
            <entry>
              <para>env</para>
            </entry>
            <entry>
              <para>http://www.w3.org/2003/05/soap-envelope</para>
            </entry>
          </row>
          <row>
            <entry>
              <para>ter</para>
            </entry>
            <entry>
              <para>http://www.onvif.org/ver10/error</para>
            </entry>
          </row>
          <row>
            <entry>
              <para>xs </para>
            </entry>
            <entry>
              <para>http://www.w3.org/2001/XMLSchema </para>
            </entry>
          </row>
          <row>
            <entry>
              <para>tt</para>
            </entry>
            <entry>
              <para>http://www.onvif.org/ver10/schema</para>
            </entry>
          </row>
          <row>
            <entry>
              <para>tr2</para>
            </entry>
            <entry>
              <para>http://www.onvif.org/ver20/media/wsdl</para>
            </entry>
          </row>
          <row>
            <entry>
              <para>tns1</para>
            </entry>
            <entry>
              <para>http://www.onvif.org/ver10/topics</para>
            </entry>
          </row>
        </tbody>
      </tgroup>
    </table>
    <section>
      <title>Media profiles</title>
      <para>Real-time video and audio streaming configurations are controlled using media profiles. A media profile maps a video and/or audio source to a video and/or an audio encoder, PTZ and analytics configurations. An ONVIF compliant device supporting the media service presents different available profiles depending on its capabilities (the set of available profiles might change dynamically though). </para>
      <figure>
        <title>A media profile</title>
        <mediaobject>
          <imageobject>
            <imagedata fileref="media/Media2/image2.jpeg" contentwidth="92.54mm" />
          </imageobject>
        </mediaobject>
      </figure>
      <para>A device may provide “ready to use” profiles for the most common media configurations that the device offers. The Profile contains a “fixed” attribute that indicates if a profile can be deleted or not. The fixed attribute does not signal that a profile is immutable. Hence it shall be possible to add or remove configurations to or from a fixed profile. Whether a profile is fixed or not is defined by the device. </para>
      <para>A profile consists of a set of interconnected <emphasis>configuration entities. </emphasis>Configurations are provided by the device and can be either static or created dynamically by the device. For example, the dynamic configurations can be created by the device depending on current available encoding resources. A configuration entity is one of the following:</para>
      <itemizedlist>
        <listitem>
          <para>Video source configuration</para>
        </listitem>
        <listitem>
          <para>Audio source configuration</para>
        </listitem>
        <listitem>
          <para>Video encoder configuration</para>
        </listitem>
        <listitem>
          <para>Audio encoder configuration</para>
        </listitem>
        <listitem>
          <para>PTZ configuration</para>
        </listitem>
        <listitem>
          <para>Video analytics configuration</para>
        </listitem>
        <listitem>
          <para>Metadata configuration</para>
        </listitem>
        <listitem>
          <para>Audio output configuration</para>
        </listitem>
        <listitem>
          <para>Audio decoder configuration</para>
        </listitem>
      </itemizedlist>
      <para>A profile consists of all or a subset of these configuration entities. Depending on the capabilities of the device, a particular configuration entity can be part of a profile or not. For example, a profile with an audio source and an audio encoder configuration can exist only in a device with audio support. </para>
      <para>An example of a complete profile configuration is illustrated in <xref linkend="_Ref210451597" />.</para>
      <figure xml:id="_Ref210451597">
        <title>Figure 2: Complete profile configuration </title>
        <mediaobject>
          <imageobject>
            <imagedata fileref="media/Media2/mediaProfile.svg" contentwidth="140mm" />
          </imageobject>
        </mediaobject>
      </figure>
      <para>A media profile describes how and what to present to the client in a media stream as well as how to handle PTZ input and Analytics. </para>
      <para>The following commands manage Media Profiles:</para>
      <itemizedlist>
        <listitem>
          <para>
            <emphasis>CreateProfile </emphasis>– Creates a new media profile.</para>
        </listitem>
        <listitem>
          <para>
            <emphasis>GetProfiles</emphasis> – Get one or all existing media profiles.</para>
        </listitem>
        <listitem>
          <para>
            <emphasis>DeleteProfile</emphasis> – Deletes a specific media profile.</para>
        </listitem>
        <listitem>
          <para>
            <emphasis>AddConfiguration </emphasis>– Adds or replaces configuration entities of a media profile.</para>
        </listitem>
        <listitem>
          <para>
            <emphasis>RemoveConfiguration </emphasis>– Removes one or more configuration entities from a media profile.</para>
        </listitem>
      </itemizedlist>
      <para>The following commands manage Configuration Entities:</para>
      <itemizedlist>
        <listitem>
          <para>
            <emphasis>Get&lt; entity&gt;ConfigurationOptions</emphasis> – Gets the valid property values for a specific configuration entity.</para>
        </listitem>
        <listitem>
          <para>
            <emphasis>Get&lt;entity&gt;Configurations</emphasis> – Gets one or more configuration entities. The client may request a specific configuration by providing the configuration token, it may specify a profile token to get all compatible configurations. If no token is specified all existing configurations are returned.</para>
        </listitem>
        <listitem>
          <para>
            <emphasis>Set&lt; entity&gt;Configuration</emphasis> – Updates the settings of a configuration entity.</para>
        </listitem>
      </itemizedlist>
      <para>Where <emphasis>&lt; entity&gt;</emphasis> is the type of configuration entity. For example, the complete command to get a video encoder configuration is GetVideoEncoderConfiguration<emphasis>.</emphasis></para>
      <para>The following commands initiate and manipulate a video/audio stream:</para>
      <itemizedlist>
        <listitem>
          <para>
            <emphasis>GetStreamUri </emphasis>– Requests a valid streaming URI for a specific media profile and protocol.</para>
        </listitem>
        <listitem>
          <para>
            <emphasis>StartMulticastStreaming </emphasis>– Starts multicast streaming using a specified media profile.</para>
        </listitem>
        <listitem>
          <para>
            <emphasis>StopMulticastStreaming </emphasis>– Stops a multicast stream.</para>
        </listitem>
        <listitem>
          <para>
            <emphasis>SetSynchronizationPoint</emphasis> – Inserts a synchronization point (I-frame etc) in active streams.</para>
        </listitem>
        <listitem>
          <para>
            <emphasis>GetSnapshotUri </emphasis>– Requests a URI for a specific media profile that can be used to obtain JPEG snapshots.</para>
        </listitem>
      </itemizedlist>
    </section>
    <section>
      <title>Video source mode</title>
      <para>A device can have the capability for changing video source mode which is a setting of video source as exclusion in same time. For example, device’s capability for max resolution (1920x1080@16:9 or 2048x1536@4:3) and frame rate (20fps or 30fps) can be changed by selecting each video source modes.</para>
      <para>The following commands manage video source mode.</para>
      <itemizedlist>
        <listitem>
          <para>
            <emphasis>GetVideoSourceModes</emphasis> - Get a list of video source modes.</para>
        </listitem>
        <listitem>
          <para>
            <emphasis>SetVideoSourceMode</emphasis> -  Set video source mode to specified mode.</para>
        </listitem>
      </itemizedlist>
    </section>
  </chapter>
  <chapter>
    <title>Service</title>
    <para>The media service is used to configure the device media streaming properties. </para>
    <para>The media service allows a client to configure media and other real time streaming configurations. Media configurations are handled through media profiles. An overview of the ONVIF media configuration model is given in Section <xref linkend="_Toc241999828" />.</para>
    <para>The media service commands are divided into two major categories:</para>
    <itemizedlist>
      <listitem>
        <para>Media configuration:</para>
        <itemizedlist>
          <listitem>
            <para>Media profile commands</para>
          </listitem>
          <listitem>
            <para>Video source commands</para>
          </listitem>
          <listitem>
            <para>Video encoder commands</para>
          </listitem>
          <listitem>
            <para>Audio source commands</para>
          </listitem>
          <listitem>
            <para>Audio encoder commands</para>
          </listitem>
          <listitem>
            <para>Video analytics commands</para>
          </listitem>
          <listitem>
            <para>Metadata commands</para>
          </listitem>
          <listitem>
            <para>Audio output commands</para>
          </listitem>
          <listitem>
            <para>Audio decoder commands</para>
          </listitem>
        </itemizedlist>
      </listitem>
      <listitem>
        <para>Media streaming:</para>
        <itemizedlist>
          <listitem>
            <para>Request stream URI</para>
          </listitem>
          <listitem>
            <para>Get snapshot URI</para>
          </listitem>
          <listitem>
            <para>Multicast control commands</para>
          </listitem>
          <listitem>
            <para>Media synchronization point</para>
          </listitem>
        </itemizedlist>
      </listitem>
    </itemizedlist>
    <para>A basic set of operations are required for the media service; other operations are recommended to support. The detailed requirements are listed under the command descriptions. </para>
    <section>
      <title>Media Profile Methods</title>
      <section>
        <title>CreateProfile</title>
        <para>This operation creates a new media profile. The media profile shall be created in the device.</para>
        <para>A device implementing this service shall support the creation of media profiles as long as the number of existing profiles does not exceed the capability value MaximumNumberOfProfiles.</para>
        <para>A created profile shall be deletable and a device shall set the “fixed” attribute to false in the returned Profile.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">Name [tt:Name]</para>
              <para role="text">Name of the new profile.</para>
              <para role="param">Configuration - optional, unbounded [tr2:ConfigurationRef]</para>
              <para role="text">Optional list of configurations to be added to the new profile. List entries with tr2:ConfigurationEnumeration value "All" shall be ignored.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">Token [tt:ReferenceToken]</para>
              <para role="text">Token assigned to the newly created profile.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Receiver - ter:Action - ter:MaxNVTProfiles</para>
              <para role="text">The maximum number of supported profiles supported by the device has been reached.</para>
              <para role="param">env:Receiver - ter:Action - ter:ConfigurationConflict</para>
              <para role="text">Other configurations of the media profile conflicts with the one to add and adding it would cause a conflicting media profile.</para>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoConfig</para>
              <para role="text">One of the provided configurations indicated by their ConfigurationToken does not exist.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">ACTUATE</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section>
        <title>GetProfiles</title>
        <para>An endpoint can ask for the existing media profiles of a device using the GetProfiles command. Both pre-configured and dynamically created profiles can be retrieved using this command.</para>
        <para> The token parameter controls which profiles are returned:</para>
        <itemizedlist>
          <listitem>
            <para>If no Token is provided this command lists all configured profiles of a device. </para>
          </listitem>
          <listitem>
            <para>If a Token is provided the command either lists the referenced profile or responds with an error.</para>
          </listitem>
        </itemizedlist>
        <para>The Type parameter controls which configurations are returned and has no effect on the number of profiles returned:</para>
        <itemizedlist>
          <listitem>
            <para>If no Type is provided the returned profiles shall contain no configuration information.</para>
          </listitem>
          <listitem>
            <para>If a single Type with value 'All' is provided the returned profiles shall include all associated configurations.</para>
          </listitem>
          <listitem>
            <para>Otherwise the requested list of configurations shall for each profile include the configurations present as Type.</para>
          </listitem>
        </itemizedlist>
        <para>A device implementing this service shall support the retrieval of media profiles through the GetProfiles command.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">Token - optional [tt:ReferenceToken]</para>
              <para role="text">Optional token to retrieve exactly one profile.</para>
              <para role="param">Type - optional, unbounded [xs:string]</para>
              <para role="text">If one or more types are passed only the corresponding configurations will be returned.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">Profiles - optional, unbounded [tr2:MediaProfile]</para>
              <para role="text">List of profiles. Each profile contains a set of configuration entities defining a specific configuration that can be used for media streaming, analytics, metadata streaming etc.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoProfile</para>
              <para role="text">The requested profile token does not exist.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">READ_MEDIA</para>
            </listitem>
          </varlistentry>
        </variablelist>
        <para xml:id="_Add_video_source">Note: a client can request an enumeration of profiles without any configuration details by not passing a Type parameter.</para>
      </section>
      <section>
        <title>AddConfiguration</title>
        <para>This operation adds one or more configurations to an existing media profile. If one of the configuration already exists in the media profile, it will be replaced. A device supporting the Media2 service shall support this command.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">ProfileToken [tt:ReferenceToken]</para>
              <para role="text">Token of an existing profile.</para>
              <para role="param">Name - optional [tt:Name]</para>
              <para role="text">The device shall update the name of the profile when this option is provided.</para>
              <para role="param">Configuration - optional, unbounded [tr2:ConfigurationRef]</para>
              <para role="text">Optional list of configurations to be added to the profile. List entries with tr2:ConfigurationEnumeration value "All" shall be ignored.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="text">This is an empty message.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoProfile</para>
              <para role="text">The requested profile token does not exist.</para>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoConfig</para>
              <para role="text">One of the provided configurations indicated by their ConfigurationToken does not exist.</para>
              <para role="param">env:Receiver - ter:Action - ter:ConfigurationConflict</para>
              <para role="text">Other configurations of the media profile conflicts with the one to add and adding it would cause a conflicting media profile.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">ACTUATE</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section>
        <title>RemoveConfiguration</title>
        <para>This operation removes one or more configurations from an existing media profile. Tokens appearing in the configuration list shall be ignored. Presence of the "All" type shall result in an empty profile. Removing a non-existing configuration shall be ignored and not result in an error. A device supporting the Media2 service shall support this command.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">ProfileToken [tt:ReferenceToken]</para>
              <para role="text">Token of an existing profile.</para>
              <para role="param">Configuration - unbounded [tr2:ConfigurationRef]</para>
              <para role="text">List of configurations to be removed from the profile.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="text">This is an empty message.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoProfile</para>
              <para role="text">The requested profile token does not exist.</para>
              <para role="param">env:Receiver - ter:Action - ter:ConfigurationConflict</para>
              <para role="text">Other configurations of the media profile are dependant on this configuration and removing it would cause a conflicting state of the media profile.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">ACTUATE</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section>
        <title>DeleteProfile</title>
        <para>This operation deletes a profile. The device shall support the deletion of a media profile through the DeleteProfile command.</para>
        <para>A device signaling support for MultiTrackStreaming shall support deleting of virtual profiles via the command. Note that deleting a profile of a virtual profile set may invalidate the virtual profile.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">Token [tt:ReferenceToken]</para>
              <para role="text">Token of an existing profile.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="text">This is an empty message.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoProfile</para>
              <para role="text">The requested profile token does not exist.</para>
              <para role="param">env:Sender - ter:Action - ter:DeletionOfFixedProfile</para>
              <para role="text">A fixed Profile cannot be deleted.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">ACTUATE</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section>
        <title>CreateMultitrackConfiguration</title>
        <para>This operation bundles a set of existing profiles to a so called virtual profile allowing multitrack streaming in a single RTSP session. </para>
        <para>A device shall except a set of profiles where all VideoSourceConfiguration elements point to different video sources and the device is able to stream the set of video sources as a multitrack stream. If the method succeeds the device shall assign the returned virtual profile token to all profiles associated to the passed list of tokens. </para>
        <para>Note that a device supporting multitrack streaming is typically shipped with one or more sets of virtual tokens. A client can use the GetProfiles command to retrieve all pre-configured profiles.</para>
        <para>A device signaling support for MultiTrackStreaming shall support creating virtual profiles via this method. Virtual profiles can be deleted using DeleteProfile.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">ProfileToken -unbounded [tt:ReferenceToken]</para>
              <para role="text">List of  existing profile Tokens.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">VirtualProfileToken [tt:ReferenceToken]</para>
              <para role="text">Token assigned to the newly created virtual profile.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoProfile</para>
              <para role="text">One or more passed profile tokens do not exist.</para>
              <para role="param">env:Sender - ter:InvalidArgVal - ter: InvalidProfileToken</para>
              <para role="text">The requested profiles can not be put together to create a virtual profile.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">ACTUATE</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
    </section>
    <section>
      <title>Media Configurations</title>
      <section>
        <title>General</title>
        <para>A media profile consists of a set of media configurations. Media profiles are used by a client to configure properties of a media stream from a device.</para>
        <para>A device shall provide at least one media profile at boot. A device should provide “ready to use” profiles for the most common media configurations that the device offers. </para>
        <para>A profile consists of a set of interconnected <emphasis>configuration entities. </emphasis>Configurations are provided by the device and can either be static or created dynamically by the device. For example, the dynamic configurations can be created by the device depending on current available encoding resources. See the following subsections for configuration entity specific constraints.</para>
        <para>The following subsections enumerate the available configurations. A profile consists of all or a subset of these configuration entities. Depending on the capabilities of the device, a particular configuration entity can be part of a profile or not. For example, a profile with an audio source and an audio encoder configuration can exist only in a device with audio support.</para>
        <para>A device shall support at least one Analytics Configuration if Analytics service is supported. A device shall support at least one PTZ Configuration if PTZ service is supported.</para>
        <para>All configurations have the following base parameters</para>
        <itemizedlist>
          <listitem>
            <para>Token – The identifier of the configuration.This parameter is read-only and cannot be modified by clients.</para>
          </listitem>
          <listitem>
            <para>Name – A configurable name of up to 64 characters.</para>
          </listitem>
          <listitem>
            <para>UseCount – Read-only property indicating the number of referenced profiles. Deprecated in Media2 – devices may support this value.</para>
          </listitem>
        </itemizedlist>
        <para>Certain configurations in a media profile are dependent on other configurations. In such cases, a device should not allow adding the dependent configuration if the required configuration isn't present. Similarly, a device should not allow removing the required configuration unless the dependent configuration is removed first. Furthermore a device shall allow adding and removing both configurations in the same AddConfiguration respective RemoveConfiguration command. The dependencies are as follow:</para>
        <itemizedlist>
          <listitem>
            <para>VideoEncoderConfiguration depends on VideoSourceConfiguration</para>
          </listitem>
          <listitem>
            <para>AudioEncoderConfiguration depends on AudioSourceConfiguration </para>
          </listitem>
          <listitem>
            <para>PTZConfiguration depends on VideoSourceConfiguration</para>
          </listitem>
          <listitem>
            <para>AudioDecoderConfiguration depends on AudioOutputConfiguration </para>
          </listitem>
          <listitem>
            <para>MetadataConfiguration depends on VideoSourceConfiguration and/or AudioSourceConfiguration</para>
          </listitem>
          <listitem>
            <para>AnalyticsConfiguration depends on VideoSourceConfiguration and/or AudioSourceConfiguration</para>
          </listitem>
        </itemizedlist>
        <para>If a dependency is violated in an AddConfiguration or RemoveConfiguration request, a ter:ConfigurationConflict fault should be returned in the response.</para>
      </section>
      <section>
        <title>Video source configuration</title>
        <para>A VideoSourceConfiguration contains a reference to a VideoSource and a Bounds
          structure containing either the whole VideoSource pixel area or a sub-portion of it. The
          Bounds and VideoSource define the image that is streamed to a client. The origin of the
          bounds is located in the upper left corner of the video source.</para>
        <para>The Rotate option specifies an optional rotation of the area defined by the Bounds
          parameters.  Three modes are defined:</para>
        <variablelist>
          <varlistentry>
            <term>Off</term>
            <listitem><para>The default value meaning that no rotation is present. The optional Degree shall be
                ignored.</para></listitem>
          </varlistentry>
          <varlistentry>
            <term>On</term>
            <listitem><para>The device shall apply the rotation value provided by the Degree parameter. If absent a
                rotation of 180 degree shall be applied.</para></listitem>
          </varlistentry>
          <varlistentry>
            <term>Auto</term>
            <listitem><para>The device shall take control over the Degree parameter and automatically update it so that a
                client can query current rotation. The device shall return the current effective
                rotation via the Degree parameter with the Video source configuration.</para></listitem>
          </varlistentry>
        </variablelist>
        <para>Note that in case of e.g. a 90 degree rotation the width parameter corresponds to the
          height of the Video and vice versa.</para>
        <para>All coordinate systems (e.g. Normalized coordinate system of Privacy Masks in the Media2 Service and pixel based coordinate system of Motion Regions in the Analytics service) that apply to a video source configuration are based on the resulting image after applying the bounds and rotation to the source image.</para>
        <para>The Lens Description option allows to describe the geometric distortion of the Video Source. For details see <xref linkend="_Ref425846456" />.</para>
        <para>The Scene Orientation options allow a description of the orientation of the scene the video source is capturing. The Scene Orientation can be Below (from the ceiling), Above (from the floor or a table) and Horizon (on a wall). Some devices may support detecting the Scene Orientation automatically.</para>
        <para>The View Mode option informs a client what type of view is represented by the video source. The view modes enumeration include</para>
        <itemizedlist>
          <listitem>
            <para>Fisheye – Undewarped viewmode from a device supporting fisheye lens.</para>
          </listitem>
          <listitem>
            <para>360Panorama – 360 degree panoramic view.</para>
          </listitem>
          <listitem>
            <para>180Panorama – 180 degree panoramic view.</para>
          </listitem>
          <listitem>
            <para>Quad – View  mode  combining  four  streams  in  single  Quad,  eg.,  applicable  for devices supporting four heads.</para>
          </listitem>
          <listitem>
            <para>Original – Unaltered view from the sensor.</para>
          </listitem>
          <listitem>
            <para>LeftHalf – Viewmode   combining   the   left   side   sensors,   applicable   for   devices supporting multiple sensors.</para>
          </listitem>
          <listitem>
            <para>RightHalf – Viewmode   combining   the   right   side   sensors,   applicable   for   devices supporting multiple sensors.</para>
          </listitem>
          <listitem>
            <para>Dewarp – Dewarped view mode for device supporting fisheye lens.</para>
          </listitem>
        </itemizedlist>
        <para>When Fisheye View Mode is present in the VideoSourceConfiguration, the device should also include the LensDescription (see <xref linkend="_Ref425846456" />).</para>
      </section>
      <section>
        <title>Video encoder configuration</title>
        <para>A VideoEncoderConfiguration contains the following parameters for configuring the encoding of video data:</para>
        <itemizedlist>
          <listitem>
            <para>Encoding – The Video Media Subtype used to compress the video. See the [IANA Media Type Reference] for a full list of values.</para>
          </listitem>
          <listitem>
            <para>Resolution – The pixel resolution of the encoded video data.</para>
          </listitem>
          <listitem>
            <para>Quality – Determines the quality of the video. A high value within supported quality range means higher quality.</para>
          </listitem>
          <listitem>
            <para>RateControl –  Defines parameters to configure the bitrate [kbps] as well as an EncodingInterval parameter (Interval at which images are encoded and transmitted) and a TargetFrameRate [fps] parameter to configure the output framerate.</para>
          </listitem>
          <listitem>
            <para>Encoding profile and GOV length [frame].</para>
          </listitem>
          <listitem>
            <para>Signed – Indicates if the stream will be signed according to the Media Signing
              Specification.</para>
          </listitem>
        </itemizedlist>
        <para>TheVideoEncoderConfiguration structure also contains multicast parameters. </para>
        <para>If the whole RateControl parameter structure is missing the current state of rate control is undefined and vendor specific. A device that supports disabling of the rate control mechanisms shall reflect that by omitting the RateControl element when disabled; otherwise it shall return the current values used for RateControl. If RateControl is missing, the respective options define whether a RateControl element can be (re-)added.</para>
        <para>The resolution's width and height are based on the Bounds field of the VideoSourceConfiguration. Therefore, if there is a 90-degree rotation, the width will represent the height of the encoded video, and the height will represent the width of the encoded video.</para>
      </section>
      <section>
        <title>Audio source configuration</title>
        <para>An Audio Source Configuration contains a reference to the AudioSource.</para>
      </section>
      <section>
        <title>Audio encoder configuration</title>
        <para>An AudioEncoderConfiguration contains the following parameters for encoding audio data:</para>
        <itemizedlist>
          <listitem>
            <para>Encoding – The Audio Media Subtype used to compress the audio. See the [IANA Media Type Reference] for a full list of values.</para>
          </listitem>
          <listitem>
            <para>Bitrate – The output bitrate [kbps].</para>
          </listitem>
          <listitem>
            <para>SampleRate – The output sample rate [kHz].</para>
          </listitem>
        </itemizedlist>
        <para>The AudioEncoderConfiguration structure also contains multicast parameters.</para>
      </section>
      <section>
        <title>PTZ Configuration</title>
        <para>A profile with a PTZConfiguration enables the streaming of PTZ status in the metadata stream. Additionally the media profile can be used for controlling PTZ movement as defined in the PTZ Service Specification.</para>
      </section>
      <section xml:id="_Ref425846556">
        <title>Analytics Configuration</title>
        <para>A profile containing a AnalyticsConfiguration enables streams using that media profile to contain analytics data (in the metadata) as defined by the submitted configuration reference. For the configuration of Analytics refer to the ONVIF Analytics Service Specification.</para>
        <para>When an analytics configuration is present in a profile, the metadata configuration can activate the streaming of the scene description within the RTP streams (see next section).</para>
        <para>A device may not allow referencing the very same AnalyticsConfiguration from multiple media profiles with different VideoSourceConfigurations. If the device allows it, it shall generate individual scene descriptions for each profile, since the coordinate system of a scene description relates to a specific VideoSourceConfiguration. Also masking and geometrical rules relate to the coordinate system of the VideoSourceConfiguration. This MAY require separate processing of the whole video analytics for each VideoSourceConfiguration, even if they refer to the very same VideoSource.</para>
      </section>
      <section>
        <title>Metadata Configuration</title>
        <para>A profile containing a MetadataConfiguration enables the streaming of metadata. Metadata can consist of events, PTZ status, and/or analytics data. </para>
        <para>For PTZ transmission of status and position change information can be enabled separately.</para>
        <para>Event streaming can be enabled and controlled using topic filters. A device signalling
          MaxContentFilterSize shall support content filtering. For topic and content filter
          configuration refer to section “Event Handling” of the ONVIF Core Specification.</para>
        <para>Streaming of scene description can be enabled. Optionally the AnalyticsEngineConfiguration allows to restrict streaming of scene description to the provided list of AnalyticsModules. Note that analytics modules only generate scene description if they are configured in the AnalyticsConfiguration of the profile as defined in section <xref linkend="_Ref425846556" />.</para>
        <para>A device shall ignore any analytics module parameters passed to the SetMetadataConfiguration command and should not list AnalyticsModule/Parameters.</para>
        <para>The structure also contains multicast parameters used to configure and control multicast of the metadata stream. Devices supporting compressed metadata shall signal available compression algorithm as defined in the MetadataCompressionType. Currently defined compression types are "GZIP" and "EXI". For details on the EXI configuration see <xref linkend="_Ref425842742" />.</para>
      </section>
      <section>
        <title>Audio output configuration</title>
        <para>The audio output configuration contains the following parameters:</para>
        <variablelist>
          <varlistentry>
            <term>SourceToken</term>
            <listitem><para>A reference to an existing audio output. </para></listitem>
          </varlistentry>
          <varlistentry>
            <term>OutputLevel</term>
            <listitem><para>A parameter to configure the output volume</para></listitem>
          </varlistentry>
          <varlistentry>
            <term>SendPrimacy</term>
            <listitem><para>A parameter that can be used for devices with a half duplex audio in/output to configure the active transmission direction (see Section <xref linkend="_Toc245780504" />).</para></listitem>
          </varlistentry>
        </variablelist>
        <section xml:id="_Toc245780504">
          <title>Audio channel modes</title>
          <para>An audio channel MAY support different types of audio transmission. While for full duplex operation no special handling is required, in half duplex operation the transmission direction needs to be switched.</para>
          <para>An optional Send-Primacy Parameter inside the AudioOutputConfiguration indicates which direction is currently active.  A client can switch between different modes by setting the AudioOutputConfiguration. </para>
          <para>The following modes for the Send-Primacy are defined:</para>
          <itemizedlist>
            <listitem>
              <para>www.onvif.org/ver20/HalfDuplex/Server</para>
              <para>The server is allowed to send audio data to the client. The client shall not send audio data via the backchannel to the device in this mode. </para>
            </listitem>
            <listitem>
              <para>www.onvif.org/ver20/HalfDuplex/Client</para>
              <para>The client is allowed to send audio data via the backchannel to the server. The device shall not send audio data to the client in this mode. </para>
            </listitem>
            <listitem>
              <para>www.onvif.org/ver20/HalfDuplex/Auto</para>
              <para>It is up to the device how to deal with sending and receiving audio data. </para>
            </listitem>
          </itemizedlist>
          <para>Acoustic echo cancellation is out of ONVIF scope.</para>
        </section>
        <section xml:id="SetEQPreset">
          <title>SetEQPreset</title>
          <para>This command configures the Audio EQPreset, provided it is supported. Refer to the <emphasis role="bold">AudioOutputConfigurationOptions</emphasis> response, associated with the audio output, to verify whether the EQPreset is supported and configurable.</para>
          <para>When a specific EQPreset is designated as the default, it will become active whenever the scheduler is inactive. Additionally, in the event of any conflicts within the scheduler, the default preset will remain active. Only one preset can be set as the default among the EQ presets linked to an audio output. If all presets have isDefault parameter set to false, the device may automatically select one preset as the default.</para>
          <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">Configuration  - [tt:EQPreset]</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="text">This message is empty.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoConfig</para>
              <para role="text">The requested configuration does not exist in the given context.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">WRITE_SYSTEM</para>
            </listitem>
          </varlistentry>
        </variablelist>
        </section>
      </section>
      <section>
        <title>Audio decoder configuration</title>
        <para>The Audio Decoder Configuration does not contain any parameter to configure the decoding . The encodings supported by an audio decoder configuration can be retrieved via the method GetAudioDecoderConfigurationOptions.</para>
      </section>
      <section>
        <title>Receiver configuration</title>
        <para>The Receiver configuration provides an alternate source for video and audio. It allows
          to pipe encoded media from an external source which than can be processed and forwarded.
          For configuration see the ONVIF Receiver Service Specification.</para>
        <para>A device supporting media profiles with receivers shall allow to add any receiver
          configuration reported by GetReceivers as long as the profile doesn't include any other
          video or audio source configuration.</para>
      </section>
    </section>
    <section>
      <title>Media Configuration Methods</title>
      <section>
        <title>General</title>
        <para>For each supported entity a device shall provide the set of Get&lt;entity&gt;Configuration, Set&lt;entity&gt;Configuration and Get&lt;entity&gt;ConfigurationOptions command.</para>
      </section>
      <section>
        <title>Get&lt;entity&gt;Configurations</title>
        <para>The Get&lt;entity&gt;Configurations operation allows to retrieve the actual settings of one ore more configurations. The syntax and semantics of the request message are the same for all configuration entities:</para>
        <itemizedlist>
          <listitem>
            <para>If a configuration token is provided the device shall respond with the requested configuration or provide an error if it does not exist.</para>
          </listitem>
          <listitem>
            <para>In case only a profile token is provided the device shall respond with all configurations that are compatible to the provided media profile.</para>
          </listitem>
          <listitem>
            <para>If no tokens are provided the device shall respond with all available configurations.</para>
          </listitem>
        </itemizedlist>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">ProfileToken - optional [tt:ReferenceToken]</para>
              <para role="text">Optional profile token to retrieve all compatible configurations.</para>
              <para role="param">ConfigurationToken - optional [tt:ReferenceToken]</para>
              <para role="text">Optional token to retrieve exactly one configuration.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">Configurations - optional, unbounded [tt:&lt;entity&gt;Configuration]</para>
              <para role="text">List of configurations. </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoProfile</para>
              <para role="text">The requested profile token does not exist.</para>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoConfig</para>
              <para role="text">The requested configuration does not exist in the given context.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">READ_MEDIA</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section>
        <title>Set&lt;entity&gt;Configuration</title>
        <para>The Set&lt;entity&gt;Configuration operation modifies a configuration. The change may have immediate effect to running streams but the changes are not guaranteed to take effect unless the client restarts any affected stream. Client methods for changing a running stream are out of scope for this specification.  </para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">Configuration [tt:&lt;entity&gt;Configuration]</para>
              <para role="text">The Configuration element contains the modified configuration. The configuration shall exist in the device.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="text">This message is empty.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoConfig</para>
              <para role="text">The requested configuration does not exist in the given context.</para>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:ConfigModify</para>
              <para role="text">The configuration parameters are not possible to set.</para>
              <para role="param">env:Receiver - ter:Action - ter:ConfigurationConflict</para>
              <para role="text">The new settings conflicts with other uses of the configuration.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">ACTUATE</para>
            </listitem>
          </varlistentry>
        </variablelist>
        <para>Note for the VideoEncoderConfiguration: if necessary the device may adapt parameter values for Quality and RateControl elements without returning an error. A device shall adapt an out of range BitrateLimit instead of returning a fault.</para>
        <para>Note for the AudioSourceConfiguration: If the new settings invalidate any parameters already negotiated using RTSP, for example by changing codec type, the device must not apply these settings to existing streams. Instead it must either continue to stream using the old settings or stop sending data on the affected streams.</para>
        <para>Note for the VideoSourceConfiguration: If a Device supports Rotation and the new settings do not contain Rotate element, a device shall keep current rotation state.</para>
      </section>
      <section>
        <title>Get&lt;entity&gt;ConfigurationOptions</title>
        <para>The Get&lt;entity&gt;ConfigurationOptions operation returns the available parameters and their valid ranges to the client. Any combination of the parameters obtained using a given media profile and configuration shall be a valid input for the corresponding set configuration command.</para>
        <para>If a configuration token is provided, the device shall return the options compatible with that configuration. If a media profile token is specified, the device shall return the options compatible with that media profile. If both a media profile token and a configuration token are specified, the device shall return the options compatible with both that media profile and that configuration. If no tokens are specified, the options shall be considered generic for the device. </para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">ConfigurationToken - optional [tt:ReferenceToken]</para>
              <para role="text">Optional token to retrieve exactly one configuration.</para>
              <para role="param">ProfileToken - optional [tt:ReferenceToken]</para>
              <para role="text">Optional profile token to retrieve all compatible configurations.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">ConfigurationOptions - unbounded [tt:&lt;entity&gt;Configuration]</para>
              <para role="text">Depending on the structure of tr2:Get&lt;entity&gt;ConfigurationOptionsResponse, the options will return one or more elements.  Note: entities AudioOutput, AudioSource, Metadata, and VideoSource return just one element.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoProfile</para>
              <para role="text">The requested profile token does not exist.</para>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoConfig</para>
              <para role="text">The requested configuration does not exist in the given context.</para>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:IncompatibleConfiguration</para>
              <para role="text">The requested configuration is not compatible.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">READ_MEDIA</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section>
        <title>GetVideoEncoderInstances</title>
        <para>This command provides information on how many video encoders a device can instantiate
          concurrently for a VideoSourceConfiguration. A device signaling support for VideoEncoder
          via the ConfigurationsSupported capability shall support this command. </para>
        <para>The Info response contains the following information:</para>
        <variablelist>
          <varlistentry>
            <term>Total</term>
            <listitem><para>Total number of encoder instances independent of the codec,</para></listitem>
          </varlistentry>
          <varlistentry>
            <term>Codec</term>
            <listitem><para>Number of encoder instances for each supported codec .</para></listitem>
          </varlistentry>
        </variablelist>
        <para>A device shall guarantee to instantiate the indicated number of instances concurrently. If a device limits the number of instances of each particular video encoding type, the response shall contain information per video codec. For each video source, there shall be at least one video source configuration for which the GetVideoEncoderInstances shall return a Total greater than 0.</para>
        <para>The total sum of video encoder instances over all video source configurations of a device shall not exceed the value signaled via MaximumNumberOfProfiles.</para>
        <para>For example, if a device has two VideoSourceConfigurations and if the first allows a total of two concurrent instances and the second allows only one instance, this device shall allow creation of at least three media profiles.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">ConfigurationToken [tt:ReferenceToken]</para>
              <para role="text">Token of the configuration.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">Info [tr2:EncoderInstanceInfo]</para>
              <para role="text">This message contains the minimum guaranteed total number of encoder instances (applications) per VideoSourceConfiguration. </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoConfig</para>
              <para role="text">The requested configuration does not exist in the given context.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">READ_MEDIA</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
    </section>
    <section xml:id="_Toc214944317">
      <title>Stream URI</title>
      <section xml:id="_Ref500832237">
        <title>GetStreamUri</title>
        <para>This operation requests a URI that can be used to initiate a live media stream using RTSP as the control protocol. The returned URI should remain valid indefinitely even if the parameters of the profile are changed. </para>
        <para>The following stream types are defined </para>
        <variablelist>
          <varlistentry>
            <term>RtspUnicast</term>
            <listitem>
              <para>RTSP streaming RTP via UDP Unicast. </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>RtspMulticast</term>
            <listitem>
              <para>RTSP streaming RTP via UDP Multicast. </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>RTSP</term>
            <listitem>
              <para>RTSP streaming RTP over TCP. </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>RtspsUnicast</term>
            <listitem>
              <para>Secure RTSP streaming SRTP via UDP Unicast. </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>RtspsMulticast</term>
            <listitem>
              <para>Secure RTSP streaming SRTP via UDP Multicast. </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>RtspOverHttp</term>
            <listitem>
              <para>Tunneling both the RTSP control channel and the RTP stream over HTTP or HTTPS. </para>
            </listitem>
          </varlistentry>
        </variablelist>
        <para>For full compatibility with other ONVIF services a device shall not generate URIs longer than 128 octets.</para>
        <para>A device that signals the RTSPStreaming capability shall support this command. On a request for transport protocol RtspOverHttp a device shall return a URI that uses the same port as the web service. This enables seamless NAT traversal.</para>
        <para>A device supporting MultiTrackStreaming shall support the retrieval of a multitrack RTSP session URI by passing a virtual profile token. </para>
        <para>A device signaling support for SecureRTSPStreaming shall support streaming via SRTP. </para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">Protocol [xs:string]</para>
              <para role="text">The Protocol defines how the encoded data is expected to be streamed to the client. </para>
              <para role="param">ProfileToken [tt:ReferenceToken]</para>
              <para role="text">The ProfileToken element indicates the media profile to use and will define the configuration of the content of the stream.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">Uri [xs:anyUri]</para>
              <para role="text">The stable Uri to be used for requesting the media stream.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoProfile</para>
              <para role="text">The requested profile token does not exist.</para>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:InvalidStreamSetup</para>
              <para role="text">The specified Protocol is not supported.</para>
              <para role="param">env:Sender - ter:OperationProhibited - ter:StreamConflict</para>
              <para role="text">The specified Protocol causes a conflict with another stream.</para>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:InvalidMulticastSettings</para>
              <para role="text">No configuration is configured for multicast.</para>
              <para role="param">env:Sender - ter:InvalidArgVal - ter: InvalidProfileToken</para>
              <para role="text">Virtual profile token corresponding source could not be spliced together.</para>
              <para role="param">env:Receiver - ter:Action - ter:IncompleteConfiguration</para>
              <para role="text">The specified media profile does not have the minimum amount of configurations to have streams. Please add at least one source configuration and one matching encoder configuration.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">READ_MEDIA</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
    </section>
    <section>
      <title>Snapshot</title>
      <section>
        <title>GetSnapshotUri</title>
        <para>A Network client uses the GetSnapshotUri command to obtain a JPEG snapshot from the device. The returned URI shall remain valid indefinitely even if the profile parameters change. The URI can be used for acquiring one or more JPEG images through an HTTP GET operation. </para>
        <para>The image encoding will always be JPEG regardless of the encoding setting in the media profile. The JPEG settings (like resolution or quality) should be taken from the profile if suitable. The provided image shall be updated automatically and independent from calls to GetSnapshotUri.</para>
        <para>A device shall support this command when the SnapshotUri capability is set to true.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">ProfileToken [tt:ReferenceToken]</para>
              <para role="text">The ProfileToken element indicates the media profile to use and will define the configuration of the content of the stream.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">Uri [xs:anyUri]</para>
              <para role="text">Stable Uri to be used for acquiring a snapshot in JPEG format as well as parameters defining the lifetime of the Uri.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoProfile</para>
              <para role="text">The requested profile token does not exist.</para>
              <para role="param">env:Receiver - ter:Action - ter:IncompleteConfiguration</para>
              <para role="text">The specified media profile does contain either unused sources or encoder configurations without a corresponding source.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">READ_MEDIA</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
    </section>
    <section>
      <title>Multicast</title>
      <para>This specification defines two mechanisms for controlling multicast streams. In addition to setting up multicast sessions via RTSP sessions as defined in section <xref linkend="_Ref500832237" /> this chapter defines a multicast streaming mechanism were the actual streaming is controlled via IGMP. Use this method with caution, since an incorrect network configuration may result in flooding the network with Audio and Video packets.</para>
      <para>A device that signals support for non-RTSP controlled multicast streaming by the AutoStartMulticast capability shall support the methods defined in this chapter.</para>
      <section>
        <title>StartMulticastStreaming</title>
        <para>This command starts multicast streaming using a specified media profile of a device.  Streaming continues until StopMulticastStreaming is called for the same Profile. The streaming shall be resumed after rebooting. It can be turned off using the StopMulticastStreaming method. The multicast address, port and TTL are configured in the VideoEncoderConfiguration, AudioEncoderConfiguration and MetadataConfiguration respectively. </para>
        <para>Multicast streaming may stop when the corresponding profile is deleted or one of its Configurations is altered via one of the set configuration methods.</para>
        <para>The implementation shall ensure that the RTP stream can be decoded without setting up an RTSP control connection. <phrase>Especially in case of H.264 video, the SPS/PPS header shall be sent inband.</phrase></para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">ProfileToken [tt:ReferenceToken]</para>
              <para role="text">The ProfileToken element indicates the media profile to use and will define the configuration of the content of the stream.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="text">This message is empty.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoProfile</para>
              <para role="text">The requested profile token does not exist.</para>
              <para role="param">env:Receiver - ter:Action - ter:IncompleteConfiguration</para>
              <para role="text">The specified media profile does not contain either a reference to a video encoder a video source configuration, to a audio source or  to audio encoder configuration or a reference to a metadata configuration</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">ACTUATE</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section>
        <title>StopMulticastStreaming</title>
        <para>This command stops multicast streaming using a specified media profile of a device. In case a device receives a StopMulticastStreaming request whose corresponding multicast streaming is not started, the device should reply with successful StopMulticastStreamingResponse.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">ProfileToken [tt:ReferenceToken]</para>
              <para role="text">The ProfileToken element indicates the media profile to use.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="text">This message is empty.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoProfile</para>
              <para role="text">The requested profile token does not exist.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">ACTUATE</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
    </section>
    <section>
      <title>Synchronization Points</title>
      <section>
        <title>SetSynchronizationPoint</title>
        <para>Synchronization points allow clients to decode and correctly use all data after the synchronization point.</para>
        <para>For example, if a video stream is configured with a large I-frame distance and a client loses a single packet, the client does not display video until the next I-frame is transmitted. In such cases, the client can request a Synchronization Point which forces the device to add an I-frame as soon as possible. Clients can request Synchronization Points for profiles. The device shall add synchronization points for all streams associated with this profile.</para>
        <para>Similarly, a synchronization point is used to get an update on full PTZ or event status through the metadata stream.</para>
        <para>If a video stream is associated with the profile, an I-frame shall be added to this video stream. If an event stream is associated to the profile, the synchronization point request shall be handled as described in the section Synchronization Point of the ONVIF Core Specification. If the profile is configured for PTZ metadata, the PTZ position shall be repeated within the metadata stream. </para>
        <para>A device shall support the request for an I-frame through the SetSynchronizationPoint command if the RTSPStreaming capability is set.</para>
        <para>If a signed video stream is associated with the profile, the video authenticity data shall be added to the stream. For details see the Media Signing Specification.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">ProfileToken [tt:ReferenceToken]</para>
              <para role="text">Profile reference for which a Synchronization Point is requested.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="text">This message is empty.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoProfile</para>
              <para role="text">The requested profile token does not exist.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">ACTUATE</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
    </section>
    <section>
      <title>Video source mode</title>
      <para>A device may have the ability to change its video source mode.  Different video source modes may affect which options are available in GetVideoSourceConfigurationOptions and GetVideoEncoderConfigurationOptions, such as only allowing 16x9 aspect ratios in one mode and only allowing 4x3 aspect ratios in another, or only allowing 30fps-derived frame rates in one mode and only allowing 25fps-derived frame rates in another.  The GetVideoSourceModes command provides summary information about the different modes supported by the device.</para>
      <section>
        <title>GetVideoSourceModes</title>
        <para>A device returns the information for current video source mode and settable video source modes of specified video source. A device that indicates a capability of  VideoSourceMode shall support this command.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">VideoSourceToken [tt:ReferenceToken]</para>
              <para role="text">The video source for which the source modes should be retrieved.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">VideoSourceMode - unbounded <phrase>[tr2:</phrase>VideoSourceMode<phrase>]</phrase></para>
              <para role="text">List of mode information with capabilities of the respective video source.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoVideoSource</para>
              <para role="text">The requested video source does not exist.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">READ_SYSTEM</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section>
        <title>SetVideoSourceMode</title>
        <para>SetVideoSourceMode changes the media profile structure relating to video source for the specified video source mode. A device that indicates a capability of VideoSourceMode shall support this command. The behavior after changing the mode is not defined in this specification.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">VideoSourceToken [tt:ReferenceToken]</para>
              <para role="text">The video source for which the source modes should be retrieved.</para>
              <para role="param">VideoSourceModeToken <phrase>[tt:</phrase>ReferenceToken<phrase>]</phrase></para>
              <para role="text">The token of the video source mode to be set.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">
                <phrase>Reboot</phrase> [xs:boolean]</para>
              <para role="text">information about rebooting after returning response. When Reboot is set “true”, a device will reboot automatically after setting mode.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoVideoSource</para>
              <para role="text">The requested video source does not exist.</para>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoVideoSourceMode</para>
              <para role="text">The requested video source mode does not exist.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">WRITE_SYSTEM</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
    </section>
    <section xml:id="_Ref411240748">
      <title>OSD (On-Screen Display)</title>
      <section>
        <title>General</title>
        <para>The OSD service provides functions to enable a client to control and configure On-Screen Display of a device. The service introduces the OSD configuration with multiple types (e.g., image, text, date, and time). Also functions to retrieve and configure the configurations are provided. All OSD configurations are related to a VideoSourceConfiguration which will display the content of OSD.</para>
        <figure>
          <title>Example of screen which have four OSD configurations and coordinate system</title>
          <mediaobject>
            <imageobject>
              <imagedata fileref="media/Media2/image3.svg" contentwidth="119.25mm" />
            </imageobject>
          </mediaobject>
        </figure>
        <para>This chapter defines methods to create and delete OSD configurations as well as gettıng, settıng and querying the options. A device that signals support for OSD via the OSD capability shall support all OSD methods defined in section <xref linkend="_Ref411240748" />.</para>
        <para>Device supporting temporary OSDTextConfiguration, shall notify TemporaryOSDText capability as defined in section <xref linkend="_Ref484170228" />. Device shall by default make all OSDTextConfigurations as persistent across reboot, but when IsPersistentText attribute in OSDTextConfiguration is set as false, OSD text content shall be cleared after reboot. OSDConfiguration shall still be valid after reboot.</para>
      </section>
      <section>
        <title>CreateOSD</title>
        <para>This operation creates a new OSD configuration with specified values and also makes the association between  the new OSD and an existing VideoSourceConfiguration identified by the VideoSourceConfigurationToken. Any value required by a device for a new OSD configuration that is optional and not present in the CreateOSD message may be adapted to the appropriate value by the device. A device that indicates OSD capability shall support the creation of OSD as long as the number of existing OSDs does not exceed the  value of MaximumNumberOfOSDs in GetOSDOptions. A created OSD configuration shall be deletable.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">OSD [tt:OSDConfiguration]</para>
              <para role="text">Contains a new OSD configuration with the specified value. The device is responsible for assigning OSD token. OSD token in CreateOSDRequest can be ignored.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">OSDToken [tt:ReferenceToken]</para>
              <para role="text">Token assigned to the newly created configuration.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Receiver - ter:Action - ter:MaxOSDs</para>
              <para role="text">The maximum number of supported OSDs by the specific VideoSourceConfiguration has been reached. </para>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoConfig</para>
              <para role="text">One of the provided configurations indicated by their ConfigurationToken does not exist.</para>
              <para role="param">env:Receiver - ter:InvalidArgVal - ter:<phrase>ConfigModify</phrase></para>
              <para role="text">The configuration parameters are not possible to set.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">ACTUATE</para>
            </listitem>
          </varlistentry>
        </variablelist>
        <para>
          <emphasis role="bold">Note:</emphasis> an OSDTextConfiguration without the IsPersistentText attribute shall be interpreted by the device as persistent.</para>
      </section>
      <section>
        <title>DeleteOSD</title>
        <para>This operation deletes an OSD configuration. </para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">OSDToken [tt:ReferenceToken]</para>
              <para role="text">Token assigned to the newly created configuration.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="text">This is an empty message.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoConfig</para>
              <para role="text">The requested OSD token OSDToken does not exist.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">ACTUATE</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section>
        <title>GetOSDs</title>
        <para>This operation lists existing OSD configurations for the device. The device shall support the listing of existing OSD configurations through the GetOSD command. If neither an OSD token nor a video source configuration token is provided the device shall respond with all available OSD configurations.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">OSDToken - optional [tt:ReferenceToken]</para>
              <para role="text">Token of an existing OSD configuration. If an OSD token is provided the device shall respond with the requested configuration or provide an error if it does not exist.</para>
              <para role="param">ConfigurationToken - optional [tt:ReferenceToken]</para>
              <para role="text">In case only a video source configuration token is provided the device shall respond with all configurations that exist for the video source configuration. </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">OSD - optional, unbounded [tt:OSDConfiguration]</para>
              <para role="text">List of OSD configurations.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoConfig</para>
              <para role="text">The requested OSD token OSDToken does not exist.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">READ_MEDIA</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section>
        <title>SetOSD</title>
        <para>This operation modifies an OSD configuration. Running streams using this configuration may be immediately updated according to the new settings. </para>
        <para>A device shall accept any combination of parameters returned by GetOSDOptions. If necessary the device may adapt parameter values for  FontColor, FontSize, and BackgroundColor elements without returning an error. Modifying the configuration token is not supported.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">OSD [tt:OSDConfiguration]</para>
              <para role="text">The OSD element contains the modified OSD configuration. The Configuration contains an element that specifies the OSD whose configuration is to be modified. The OSD shall exist in the device.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="text">This is an empty message.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoConfig</para>
              <para role="text">The requested OSD token OSDToken does not exist.</para>
              <para role="param">env:Receiver - ter:InvalidArgVal - ter:<phrase>ConfigModify</phrase></para>
              <para role="text">The configuration parameters are not possible to set.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">ACTUATE</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section>
        <title>GetOSDOptions</title>
        <para>This operation returns the available options when the OSD parameters are reconfigured. The device shall support the listing of available OSD parameter options (for a given video source  configuration) through the GetOSDOptions command. Any combination of the parameters obtained using a given video source configuration shall be a valid input for the corresponding SetOSD command.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">ConfigurationToken - [tt:ReferenceToken]</para>
              <para role="text">The ConfigurationToken element specifies the video source configuration of which the suitable OSD options are requested. The Video Source Configuration Token shall exist in the device.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">OSDOptions [tt:OSDConfigurationOptions]</para>
              <para role="text">the OSD options which are suitable for the video source configuration specified in the request.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoConfig</para>
              <para role="text">The requested video source configuration ConfigurationToken does not exist.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">READ_MEDIA</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section>
        <title>OSD Images</title>
        <para>The ImageOption section of the GetOSDOptions response contains ImagePath, a list of URIs defining images on the device. If the FormatsSupported attribute of ImageOption is set,  any  URI in the ImagePath list may be used to upload (POST) an image. Otherwise, the list  defines references to images that may have been installed on the device outside of the ONVIF scope.</para>
        <para>A device that returns the FormatsSupported attribute shall support at least the MIME type image/png. The device shall also return a MaxSize attribute of at least 1024 bytes, or MaxWidth and MaxHeight attributes of at least 16 pixels, or all three attributes. If all three attributes are provided, uploaded images that do not satisfy all three requirements shall be rejected.</para>
        <para>The number of image paths in ImagePath defines how many images may be stored on the device. When posting an image to one of the URIs, the following HTML status codes may be returned, depending on success or failure:</para>
        <variablelist>
          <varlistentry>
            <term>200 OK or 201 Created</term>
            <listitem><para>Image file was successfully uploaded </para></listitem>
          </varlistentry>
          <varlistentry>
            <term>401 Unauthorized</term>
            <listitem><para>Attempted POST without authentication credentials at the ACTUATE access policy level.</para></listitem>
          </varlistentry>
          <varlistentry>
            <term>404 Not Found</term>
            <listitem><para>Attempted POST to a URI not included in ImagePath list </para></listitem>
          </varlistentry>
          <varlistentry>
            <term>408 Request Timeout</term>
            <listitem><para>POST took too long to upload.</para></listitem>
          </varlistentry>
          <varlistentry>
            <term>411 Length Required</term>
            <listitem><para>POST does not include Content-Length header</para></listitem>
          </varlistentry>
          <varlistentry>
            <term>413 Request Entity Too Large</term>
            <listitem>
              <para>File is larger than MaxSize attribute allows, image is larger than MaxWidth or MaxHeight attributes allow, or insufficient device storage space </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>415 Unsupported Media Type</term>
            <listitem><para>POST does not include Content-Type header, or file MIME type does not match any</para></listitem>
          </varlistentry>
        </variablelist>
        
        <para> type in the FormatsSupported attribute's list </para>
        <para>If an image is successfully uploaded but has a resolution larger than supported by the device,  the device shall crop or resize the image and will not return an error.</para>
        <para>A device that returns the FormatsSupported attribute shall download any OSD image listed in  the ImgPath list  with the GET method on the URI. The response shall include the  appropriate Content-Type HTML header so the client knows how to interpret the image. When retrieving  an  image from one of the URIs, the following HTML status codes may be returned, depending on success or failure:</para>
        <variablelist>
          <varlistentry>
            <term>200 OK</term>
            <listitem><para>Image file was successfully returned in the response.</para></listitem>
          </varlistentry>
          <varlistentry>
            <term>401 Unauthorized</term>
            <listitem><para>attempted GET without authentication credentials at the READ_MEDIA access policy.</para></listitem>
          </varlistentry>
          <varlistentry>
            <term>404 Not Found</term>
            <listitem><para>attempted GET of a URI not included in ImagePath list, or no uploaded image exists at the requested URI location </para>
            </listitem>
          </varlistentry>
        </variablelist>
        <para>The images returned by GetOSDOptions may be utilized by SetOSD. ImgPath in the SetOSD request may specify any image path listed by GetOSDOptions. If SetOSD specifies a valid image path which does not yet have an associated uploaded image, the device may either treat the image as a 0x0 pixel image, or may return the ter:NoConfig fault.</para>
      </section>
    </section>
    <section>
      <title>Privacy Masks</title>
      <section>
        <title>General</title>
        <para>Privacy Masks allow to cover regions of the image. The device signals via the options how many masks and how many edges each mask may support. Additionally devices may restrict to support rectangle masks only. <xref linkend="_Ref475005468" /> shows how the mask is defined by a polygon using normalized coordinates relative to the VideoSourceConfiguration window.</para>
        <figure xml:id="_Ref475005468">
          <title>Example of screen with mask and coordinate system</title>
          <mediaobject>
            <imageobject>
              <imagedata fileref="media/Media2/image4.png" contentwidth="85.93mm" />
            </imageobject>
          </mediaobject>
        </figure>
        <para>A device may support automatic update of the mask location and shape depending on internal operation. Details are outside of the scope of this specification.</para>
        <para>Depending on the supported options a device may support the following mask types:</para>
        <itemizedlist>
          <listitem>
            <para>Color	The device signals which color values or ranges are supported. Additionally a device may signal that it supports a single color for all masks of a VideoSourceConfiguration.</para>
          </listitem>
          <listitem>
            <para>Blurred	The masked area is defocused.</para>
          </listitem>
          <listitem>
            <para>Pixelized	The masked area is covered with a mosaic.</para>
          </listitem>
        </itemizedlist>
      </section>
      <section>
        <title>CreateMask</title>
        <para>This operation creates a new Mask for an existing VideoSourceConfiguration. A device that signals support for Masks by the Mask capability shall support the creation of masks via this function as long as the number of existing masks does not exceed the value of MaxMasks for the given VideoSourceConfiguration. </para>
        <para>A device shall ignore the mask token passed in the command.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">Mask [tr2:Mask]</para>
              <para role="text">Contains the new mask configuration. The device is responsible for assigning the mask token.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">Token [tt:ReferenceToken]</para>
              <para role="text">Token assigned to the newly created mask.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Receiver - ter:Action - ter:MaxMasks</para>
              <para role="text">The maximum number of supported masks by the specific VideoSourceConfiguration has been reached. </para>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoConfig</para>
              <para role="text">The provided video source configuration does not exist.</para>
              <para role="param">env:Receiver - ter:InvalidArgVal - ter:<phrase>InvalidPolygon</phrase></para>
              <para role="text">The provided polygon is not supported.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">ACTUATE</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section>
        <title>DeleteMask</title>
        <para>This operation deletes a mask configuration. </para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">Token [tt:ReferenceToken]</para>
              <para role="text">Token assigned to the newly created mask.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="text">This is an empty message.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoConfig</para>
              <para role="text">The requested Mask token does not exist. </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">ACTUATE</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section>
        <title>GetMasks</title>
        <para>This operation lists existing Mask configurations for the device. A device signaling support for the Mask capability shall support the listing of existing Mask configurations through this command. In case neither a mask nor configuration tokens is provided the device shall respond with all available Mask configurations in the device.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">MaskToken - optional [tt:ReferenceToken]</para>
              <para role="text">If a mask token is provided the device shall respond with the requested configuration or provide an error if it does not exist.</para>
              <para role="param">ConfigurationToken - optional [tt:ReferenceToken]</para>
              <para role="text">In case only a video source configuration token is provided the device shall respond with all configurations that exist for the video source configuration.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">Mask - optional, unbounded [tr2:Mask]</para>
              <para role="text">List of masks.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoConfig</para>
              <para role="text">The requested video source configuration or Mask indicated with MaskToken does not exist.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">READ_MEDIA</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section>
        <title>SetMask</title>
        <para>This operation modifies a mask configuration. Running streams using this configuration may be immediately updated according to the new settings. </para>
        <para>A device signaling support for Mask via its capabilities support this command. It shall accept any combination of parameters returned by GetMaskOptions. If necessary the device may adapt parameter values for the Color and Polygon element without returning an error.</para>
        <para>Note that for devices signaling SingleColorOnly all masks of the associated VideoSource will be updated.</para>
        <para>Note: A device signaling RectangleOnly shall accept any polygon with four points. In case the four vertices are not defining an exact rectangle the device may adjust the vertices.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">Mask [tr2:Mask]</para>
              <para role="text">Contains the new mask configuration. The device is responsible for assigning the mask token.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="text">This is an empty message.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoConfig</para>
              <para role="text">The provided video source configuration does not exist.</para>
              <para role="param">env:Receiver - ter:InvalidArgVal - ter:<phrase>ConfigModify</phrase></para>
              <para role="text">The configuration parameters are not possible to set.</para>
              <para role="param">env:Receiver - ter:InvalidArgVal - ter:<phrase>InvalidPolygon</phrase></para>
              <para role="text">The provided polygon is not supported.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">ACTUATE</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section>
        <title>GetMaskOptions</title>
        <para>This operation returns the available options when the Mask parameters are reconfigured. A device signaling support for Mask via its capabilities shall support the listing of available Mask parameter options (for a given video source  configuration) via this command. Any combination of the parameters obtained using a given video source configuration shall be a valid input for the corresponding SetMask command.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">ConfigurationToken [tt:ReferenceToken]</para>
              <para role="text">Token of an existing configuration for which all existing masks should be listed.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">Options [tr2:MaskOptions]</para>
              <para role="text">This message contains the Mask options which are suitable for the video source configuration specified in the request</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoConfig</para>
              <para role="text">The requested video source configuration does not exist.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">READ_MEDIA</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
    </section>
    <section xml:id="section_k4m_bbc_yyb">
      <title>WebRTC</title>
      <section>
        <title>WebRTC configuration</title>
        <para>This section is about configuring one or more WebRTC signaling servers that a device
          should connect to, in order to be able to receive requests from clients and establish peer-to-peer
          WebRTC connections. The signaling protocol that is used for this is descibed in the [ONVIF
          WebRTC Specification]. A WebRTC configuration has the following parameters:</para>
        <itemizedlist>
          <listitem>
            <para>Enabled [xs:boolean] – Enables/disables the configuration.</para>
          </listitem>
          <listitem>
            <para>Connected [xs:boolean] – Indicates if the device is connected to the server. This
              parameter is read-only.</para>
          </listitem>
          <listitem>
            <para>SignalingServer [xs:anyURI] – The signaling server URI.</para>
          </listitem>
          <listitem>
            <para>CertPathValidationPolicyID [xs:string] - The policy for validating the signaling server certificate.</para>
          </listitem>
          <listitem>
            <para>AuthorizationServer [tt:ReferenceToken] – The Authorization Server to use for
              getting access tokens. This refers to an entity in the list of configured
              Authorization Servers in the [ONVIF Security Service Specification].</para>
          </listitem>
          <listitem>
            <para>DefaultProfile [tt:ReferenceToken] – The default media profile to use for
              streaming if no specific profile is specified when initializing a session.</para>
          </listitem>
          <listitem>
            <para>Error [xs:string] - Optional user readable error information (readonly).</para>
          </listitem>
        </itemizedlist>
      </section>
      <section xml:id="section_wys_czg_ryb">
        <title>GetWebRTCConfigurations</title>
        <para>This operation gets the current WebRTC configuration for the device. The operation
          shall be supported if the WebRTC capability is present.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="text">This is an empty message.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">Configuration - optional, unbounded
                [tr2:WebRTCConfiguration]</para>
              <para role="text">This message contains the WebRTC configurations for the device. If
                empty, no configurations have been configured,</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="text">No command specific faults defined.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">READ_SYSTEM</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section xml:id="section_wvd_dzg_ryb">
        <title>SetWebRTCConfigurations</title>
        <para>This operation shall synchronise the tr2:WebRTCConfiguration list with the configuration stored on
          the device, by creating new entries, updating existing ones, and deleting those omitted from
          the input. The operation shall be supported if the WebRTC capability is present. The
          device shall attempt to establish a connection to each signaling server where the
            <emphasis role="bold">Enabled</emphasis> parameter is set to true in the associated
          tr2:WebRTCConfiguration. </para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">Configuration - optional, unbounded
                [tr2:WebRTCConfiguration]</para>
              <para role="text">This message contains the WebRTC configurations to use for the
                device. If empty, existing WebRTC configurations are deleted.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="text">This is an empty message.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Receiver - ter:Action - ter:MaxWebRTCConfiguration</para>
              <para role="text">The maximum number of configurations supported by the device has been reached.</para>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:InvalidConfig</para>
              <para role="text">The configuration parameters are not possible to set.</para>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoAuthorizationServer</para>
              <para role="text">The authorization server token does not exist.</para>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoProfile</para>
              <para role="text">The profile token does not exist.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">WRITE_SYSTEM</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
    </section>
	<section xml:id="section_k4m_bcd_yyz">
      <title>Audio Clip Management</title>
      <section>
        <title>Audio Clip Configuration</title>
        <para>This section is about uploading one or more pre-recorded audio clips to the device. The uploaded audio clips can be played by the user on a need basis, for example on a configured schedule, or when an associated event is triggered. The audio clip configuration includes the following parameters:</para>
        <itemizedlist>
          <listitem>
            <para>Enabled [xs:boolean] – Enables/disables the audio clip.</para>
          </listitem>
          <listitem>
            <para>Name [xs:string] – Name of the audio clip.</para>
          </listitem>          
		  <listitem>
            <para>AudioOutputToken [tt:ReferenceToken] optional, unbounded – Optional token list of physical audio outputs. If no AudioOutputToken is provided, the device should play the audio clip through all physical audio outputs.</para>
          </listitem>
          <listitem>
            <para>Type [xs:string] - Format of the audio clip. Supported audio Clip formats includes audio/vnd.wave;codec=1(WAV with LPCM), audio/vnd.wave;codec=7(WAV with G711-ulaw), audio/mpeg(MP3), audio/ogg;codecs=opus, audio/ogg;codecs=vorbis, audio/ogg;codecs=flac, audio/ogg;codecs=speex.</para>
          </listitem>          
          <listitem>
            <para>RepeatCycles [xs:int] - The number of times the audio clip can be repeated when it is played. A value of 0 means no repeat (i.e., the audio clip plays once and does not repeat). A value of 1 means the audio clip plays once and repeats once after the first play. A value of -1 means the audio clip repeats infinitely after the first play until it is stopped by the user.</para>
          </listitem>
		  <listitem>
            <para>RepeatInterval [xs:int] optional - Optional time interval, in seconds, between audio clips when the audio clip is repeated.</para>
          </listitem>
		  <listitem>
            <para>AudioOutputLevel [xs:int] optional - Optional level to control the volume of the audio clip when it is played. The device should automatically adjust the output level for a particular audio output when the parameter is outside its range.</para>
          </listitem>
		  <listitem>
            <para>ScheduleToken [tt:ReferenceToken] optional - Optional schedule token associated with the audio clip configuration. The audio clip should be played when the configured schedule is triggered.</para>
          </listitem>		 
        </itemizedlist>
        <para>The device should accept an optional ScheduleToken from the client if it supports the ONVIF Schedule service specification.</para>
      </section>
      <section xml:id="section_wys_czg_ryc">
        <title>GetAudioClips</title>
        <para>This operation retrieves audio clip configurations from the device. If an audio clip token is provided, the device shall return the audio clip configuration associated with that token. If no token is provided, the device shall return all audio clip configurations that exist on the device.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">Token - optional
                [tt:ReferenceToken]</para>
              <para role="text">Token associated with the audio clip.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
			  <para role="param">AudioClipItem - optional, unbounded [tr2:GetAudioClipsResponseItem]  </para>
              <para role="text">List of audio clip items.</para>              
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoAudioClip</para>
              <para role="text">The audio clip token does not exist.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">READ_SYSTEM</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section xml:id="section_wvd_dzg_ryd">
        <title>AddAudioClip</title>
        <para>This operation adds audio clip configuration to the device and provides the audio clip upload 
		URI to the client. The response to the command includes an HTTP URL to which the audio clip may be uploaded	with in the expiry time. If the client is unable to upload the audio clip within the URL's expiry time, the associated audio clip configuration will deleted from the device.
    The device shall return the audio clip configuration in the GetAudioClips API response only after the audio clip has actually been uploaded to the device.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
			<para role="param">Token - optional[tt:ReferenceToken]</para>
              <para role="text"> Optional token associated with the audio clip.</para>
              <para role="param">Configuration - 
                [tr2:AudioClip]</para>
              <para role="text"> Audio clip configuration to add.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">Token - [tt:ReferenceToken]</para>
              <para role="text">Unique token of the audio clip to be uploaded.</para>
              <para role="param">UploadUri - [xs:anyURI]</para>
              <para role="text">A URL to which the audio clip can be uploaded.</para>
              <para role="param">ExpiryTime - [xsd:DateTime]</para>
              <para role="text">Expiry time by which the client should upload the audio clip to the device.</para>             
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Receiver - ter:Action - ter:MaxAudioClipLimit</para>
              <para role="text">The maximum number of audio clip configurations supported by the device has been reached.</para>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:InvalidConfig</para>
              <para role="text">The configuration parameters are not possible to set.</para>         
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">WRITE_SYSTEM</para>
            </listitem>
          </varlistentry>
        </variablelist>
        <para></para>
        <para><emphasis role="bold">Note:</emphasis> Audio clip uploads to the device can fail in the following scenarios, and a specific HTTP error code should be returned to the client when an upload fails.</para>
        <itemizedlist>
          <listitem>
            <para>When the upload URL has expired, the device should return an HTTP 410 error to the client.</para>
          </listitem>
          <listitem>
            <para>When the format of the audio clip upload does not match the Type parameter in the audio clip configuration, the device should return an HTTP 415 Unsupported Media Type error to the client.</para>
          </listitem>
          <listitem>
            <para>When the size of the audio clip upload exceeds the MaxAudioClipSize parameter in KB, the device should return an HTTP 413, Request Entity Too Large error to the client.</para>
          </listitem>
        </itemizedlist>              
      </section>    
	  <section xml:id="section_wvd_dzg_rye">
        <title>SetAudioClip</title>
        <para>This operation modifies the existing audio clip configuration on the device.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
			<para role="param">Token - [tt:ReferenceToken]</para>
              <para role="text"> Unique token associated with the audio clip.</para>
              <para role="param">Configuration - 
                [tr2:AudioClip]</para>
              <para role="text"> Audio clip configuration to modify.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="text">This is an empty message.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
			  <para role="param">env:Sender - ter:InvalidArgVal - ter:NoAudioClip</para>
              <para role="text">The audio clip token does not exist.</para>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:InvalidConfig</para>
              <para role="text">The configuration parameters are not possible to set.</para>         
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">WRITE_SYSTEM</para>
            </listitem>
          </varlistentry>
        </variablelist>
	    <para> Note: The format of the audio clip cannot be changed during the SetAudioClip operation.</para>
      </section> 
	  <section xml:id="section_wvd_dzg_ryf">
        <title>DeleteAudioClip</title>
        <para>This operation deletes the audio clip configuration and the associated audio clip on the device. The audio clip should be de-associated from the event or schedule trigger if it was previously associated before this operation. This operation will fail if the device is playing the audio clip at the same time due to user operation, schedule, or event trigger.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">Token - 
                [tt:ReferenceToken]</para>
              <para role="text"> Token of the audio clip to be deleted from the device.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="text">This is an empty message.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:NoAudioClip</para>
              <para role="text">The audio clip token does not exist.</para>
              <para role="param">env:Sender - ter:InvalidArgVal - ter:AudioClipDeleteError</para>
              <para role="text">The audio clip cannot be deleted due to the device's current usage.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">WRITE_SYSTEM</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
	  <section xml:id="section_wvd_dzg_ryg">
        <title>PlayAudioClip</title>
        <para>This operation plays or stops the ongoing audio clip on the device. If a new audio clip play request is received from the client while another clip is playing, the device shall stop the current audio clip and start the new audio clip.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">Token - [tt:ReferenceToken]</para>
              <para role="text"> Token of the audio clip to be played or stopped.</para>
              <para role="param">AudioOutputToken - optional, unbounded [tt:ReferenceToken]</para>
              <para role="text"> Optional token list of physical audio outputs. If the AudioOutputToken is not provided in the API request, the AudioOutputToken from the audio clip configuration will be used.</para>
              <para role="param">Play - [xs:boolean]</para>
              <para role="text"> If it is true, play the audio clip; if it is false, stop the ongoing audio clip.</para>
			  <para role="param">RepeatCycles - optional [xs:int]</para>
              <para role="text"> Optional RepeatCycles to be used for the current play operation. If RepeatCycles is not provided in the API request, the RepeatCycles specified in the audio clip configuration will be used for the current play operation.</para>             
            </listitem>			       
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="text">This is an empty message.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
		<para role="param">env:Sender - ter:InvalidArgVal - ter:NoAudioClip</para>
		<para role="text">The audio clip token does not exist.</para>
		<para role="param">env:Sender - ter:InvalidArgVal - ter:NoAudioOutput</para>
		<para role="text">The audio output token does not exist.</para>
		<para role="param">env:Sender - ter:InvalidArgVal - ter:PlayAudioClipError</para>
		<para role="text">The audio clip is disabled for the play operation.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">READ_SYSTEM</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
	  <section xml:id="section_wvd_dzg_ryh">
        <title>GetPlayingAudioClips</title>
        <para>This operation retrieves audio clips information which are playing currently in the device.</para>
        <variablelist role="op">
         <varlistentry>
            <term>request</term>
            <listitem>
              <para role="text">This is an empty message.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
			  <para role="param">PlayingAudioClips - optional, unbounded [tr2:PlayingAudioClips]</para>
              <para role="text">List of audio clips currently playing in the device.</para>              
            </listitem>
          </varlistentry>
		  <varlistentry>
          <term>faults</term>
          <listitem>
            <para role="text">None</para>
          </listitem>
         </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">READ_SYSTEM</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
	</section>
    <section xml:id="_Ref484170228">
      <title>GetServiceCapabilities</title>
      <para>The capabilities reflect optional functions and functionality of a service. The information is static and does not change during device operation. </para>
      <variablelist role="op">
        <varlistentry>
          <term>request</term>
          <listitem>
            <para role="text">This is an empty message.</para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>response</term>
          <listitem>
            <para role="param">Capabilities [tr2:Capabilities2]</para>
            <para role="text">List of capabilities as defined above.</para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>faults</term>
          <listitem>
            <para role="text">None</para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>access class</term>
          <listitem>
            <para role="access">PRE_AUTH</para>
          </listitem>
        </varlistentry>
      </variablelist>
      <para>The following profile capabilites are available:</para>
      <variablelist>
        <varlistentry>
          <term>MaximumNumberOfProfiles</term>
          <listitem><para>The sum of fixed and dynamic MediaProfiles supported by the
            device. A device implementing this service shall provide this capability.</para></listitem>
        </varlistentry>
        <varlistentry>
          <term>ConfigurationsSupported</term>
          <listitem>
            <para> The configurations supported by the device as defined by
              tr2:ConfigurationEnumeration. The enumeration value "All" shall not be included in this
              list. A device implementing this service shall provide this capability.</para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>SnapshotUri</term>
          <listitem><para>Indicates the support for GetSnapshotUri.</para></listitem>
        </varlistentry>
        <varlistentry>
          <term>Rotation</term>
          <listitem><para>Indicates the support for the Rotation feature.</para></listitem>
        </varlistentry>
        <varlistentry>
          <term>VideoSourceMode</term>
          <listitem><para>Indicates the support for changing video source mode.</para></listitem>
        </varlistentry>
        <varlistentry>
          <term>OSD</term>
          <listitem><para>Indicates support for OSD configuration</para></listitem>
        </varlistentry>
        <varlistentry>
          <term>TemporaryOSDText</term>
          <listitem><para>Indicates the support for temporary osd text configuration.</para></listitem>
        </varlistentry>
        <varlistentry>
          <term>Mask</term>
          <listitem><para>Indicates support for mask configuration.</para></listitem>
        </varlistentry>
        <varlistentry>
          <term>SourceMask</term>
          <listitem>
            <para>Indicates that privacy masks are only supported at the video source level
            and not the video source configuration level. If this is true any addition, deletion or
            change of a privacy mask done for one video source configuration will automatically be
            applied by the device to a corresponding privacy mask for all other video source
            configuration associated with the same video source.</para>
          </listitem>
        </varlistentry>
      </variablelist>
      <para>The following streaming capabilites are available:</para>
      <variablelist>
        <varlistentry>
          <term>RTSPStreaming</term>
          <listitem><para>Indicates the support for live media streaming via RTSP.</para></listitem>
        </varlistentry>
        <varlistentry>
          <term>SecureRTSPStreaming</term>
          <listitem><para>Indicates support for live media streaming via RTSPS and SRTP.</para></listitem>
        </varlistentry>
        <varlistentry>
          <term>RTPMulticast</term>
          <listitem><para>Indication of support of UDP multicasting as described in sections <xref linkend="_Toc214944317"/>.</para></listitem>
        </varlistentry>
        <varlistentry>
          <term>RTP_RTSP_TCP</term>
          <listitem><para>Indicates the support for RTP/RTSP/TCP transport as defined in section
            5.1.1.3 of the ONVIF Streaming Specification.</para></listitem>
        </varlistentry>
        <varlistentry>
          <term>NonAggregateControl</term>
          <listitem><para>Indicates support for non aggregate RTSP control as described in
            section 5.2.1.1 of the ONVIF Streaming Specification.</para></listitem>
        </varlistentry>
        <varlistentry>
          <term>RTSPWebSocketUri</term>
          <listitem><para>Indicates the support for RTSP/RTP streaming over WebSocket and
            provides the WebSocket URI, as described in Streaming Specification Section 5.1.1.5.</para></listitem>
        </varlistentry>
        <varlistentry>
          <term>AutoStartMulticast</term>
          <listitem><para>Indicates support for non-RTSP controlled multicast streaming.</para></listitem>
        </varlistentry>
        <varlistentry>
          <term>MultiTrackStreaming</term>
          <listitem><para>Indicates support for multiple video RTP streams in one RTSP session.</para></listitem>
        </varlistentry>
        <varlistentry>
          <term>WebRTC</term>
          <listitem>
            <para>Indicates the supported number of WebRTC configurations.</para>
          </listitem>
        </varlistentry>
      </variablelist>
      <para>The following media signing capabilites are available:</para>
      <variablelist>
        <varlistentry>
          <term>MediaSigningSupported</term>
          <listitem><para>Indicates whether the device supports signing of media according to the Media Signing
              Specification.</para></listitem>
        </varlistentry>
      </variablelist>    
    <para>The following audio clip Capabilities are available:</para>
	<variablelist>
        <varlistentry>
          <term>MaxAudioClipLimit</term>
          <listitem><para>Indicates the maximum number of audio clips that can be uploaded to the device.</para></listitem>
        </varlistentry>
		<varlistentry>
          <term>MaxAudioClipSize</term>
          <listitem><para>Indicates the maximum size of the audio clip that can be uploaded, in KB.</para></listitem>
        </varlistentry>
		<varlistentry>
          <term>SupportedAudioClipFormat</term>
          <listitem><para>Enumerates the supported audio clip formats. See tr2: SupportedAudioClipFormat.</para></listitem>
        </varlistentry>
	</variablelist>
	</section>
    <section>
      <title>Events</title>
      <section>
        <title>Profile Change</title>
        <para>Whenever a profile is created, deleted or one or more of its configurations are added or removed the following event should be generated.</para>
        <programlisting><![CDATA[Topic: tns1:Media/ProfileChanged
<tt:MessageDescription>
  <tt:Source>
    <tt:SimpleItemDescription Name="Token" Type="tt:ReferenceToken"/>
  </tt:Source>
</tt:MessageDescription>]]></programlisting>
      </section>
      <section>
        <title>Configuration Change</title>
        <para>Whenever a Configuration of a device changes the device should provide the following event. For the parameter Type pass the appropriate ConfigurationEnumeration value.</para>
        <programlisting><![CDATA[Topic: tns1:Media/ConfigurationChanged
<tt:MessageDescription>
  <tt:Source>
    <tt:SimpleItemDescription Name="Token" Type="tt:ReferenceToken"/>
    <tt:SimpleItemDescription Name="Type" Type="xs:string"/>
  </tt:Source>
</tt:MessageDescription>
]]></programlisting>
      </section>
      <section>
        <title>Active Connections</title>
        <para>A device that supports the media service should provide the “Active Connections” monitoring event to inform a client about the current usage of its Media Profiles. An ONVIF compliant device shall use the following topic and message format:</para>
        <para>Topic: tns1:Monitoring/Profile/ActiveConnections</para>
        <programlisting><![CDATA[<xs:complexType name="ProfileStatus">
  <xs:sequence>
    <xs:element name="ActiveConnections" type="tt:ActiveConnection" minOccurs="0"
       maxOccurs="unbounded"/>
    <xs:element name="Extension" type="tt:ProfileStatusExtension" minOccurs="0" />
  </xs:sequence>
</xs:complexType>
<xs:complexType name="ActiveConnection">
  <xs:sequence>
    <xs:element name="CurrentBitrate" type="xs:float"/>
    <xs:element name="CurrentFps" type="xs:float"/>
    <xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
  </xs:sequence>
</xs:complexType>
<tt:MessageDescription IsProperty="true">
  <tt:Source>
    <tt:SimpleItemDescription Name="Profile" Type="tt:ReferenceToken"/>
  </tt:Source>
  <tt:Data>
    <tt:ElementItemDescription Name="Status" Type="tt:ProfileStatus"/>
  </tt:Data>
</tt:MessageDescription>
]]></programlisting>
        <para>NOTE: Active Connections Event is deprecated and its replaced by Active Sessions Event.</para>
      </section>
      <section>
        <title>Active Sessions</title>
        <para>A device that supports the media service should provide the "Active Sessions" monitoring events to inform a client about the current usage of its Media Streams. The monitoring events are sent every time a client connects to or disconnects from a unicast stream. An ONVIF compliant device shall use the following topics and message format:</para>
        <programlisting><![CDATA[
Topics: tns1:Monitoring/ActiveSessions/VideoEncoder
        tns1:Monitoring/ActiveSessions/AudioEncoder
        tns1:Monitoring/ActiveSessions/AudioDecoder
        tns1:Monitoring/ActiveSessions/Metadata
        
<tt:MessageDescription IsProperty="true">
  <tt:Source>
    <tt:SimpleItemDescription Name="Token" Type="tt:ReferenceToken"/>
  </tt:Source>
  <tt:Data>
    <tt:SimpleItemDescription Name="Sessions" Type="tt:StringAttrList"/>
  </tt:Data>
</tt:MessageDescription>
]]></programlisting>
        <para>Token refers to the appropriate Video Encoder Configuration, Audio Encoder Configuration, Audio Decoder Configuration, or Metadata Configuration token.</para>
        <para>Sessions is a space-delimited list of IPv4 and/or IPv6 addresses of active streaming clients. Multiple clients at an IP address, regardless of streaming protocol, shall be repeated once for every client. Sort order of the list is not defined.</para>
        <para>When the first session associated with an encoding resource connects, the event type is Initialized. When all sessions associated with an encoding resource have disconnected, the event type is Deleted.</para>
        <para>Example of event for a Video Encoder Configuration with a stream to IPv4 10.220.232.202 and a stream to IPv6 fc80::2934:4e3e:e559:83e9, and then connecting a second stream to 10.220.232.202 (order of Sessions list is undefined; these addresses can appear in any order, but 10.220.232.202 shall appear twice to represent the two streams):</para>
        <programlisting><![CDATA[<wsnt:Topic Dialect="...">
  tns1:Monitoring/ActiveSessions/VideoEncoder
</wsnt:Topic>
<wsnt:Message>
  <tt:Message UtcTime="..." PropertyOperation="Changed">
    <tt:Source>
      <tt:SimpleItem Name="Token" Value="vec0" />
    </tt:Source>
    <tt:Data>
      <tt:SimpleItem Name="Sessions"
        Value="10.220.232.202 fc80::2934:4e3e:e559:83e9 10.220.232.202" />
    </tt:Data>
  </tt:Message>
</wsnt:Message>
]]></programlisting>
        <para>Example of event for a Metadata Configuration when connecting its first active stream to IPv4 10.220.232.202:</para>
        <programlisting><![CDATA[<wsnt:Topic Dialect="...">
  tns1:Monitoring/ActiveSessions/Metadata
</wsnt:Topic>
<wsnt:Message>
  <tt:Message UtcTime="..." PropertyOperation="Initialized">
    <tt:Source>
      <tt:SimpleItem Name="Token" Value="af16a847-cd62-4923-9ccd-3108a16afaee" />
    </tt:Source>
    <tt:Data>
      <tt:SimpleItem Name="Sessions" Value="10.220.232.202" />
    </tt:Data>
  </tt:Message>
</wsnt:Message>
]]></programlisting>
        <para>Example of event for an Audio Encoder Configuration when all active connections are closed:</para>
        <programlisting><![CDATA[<wsnt:Topic Dialect="...">
  tns1:Monitoring/ActiveSessions/AudioEncoder
</wsnt:Topic>
<wsnt:Message>
  <tt:Message UtcTime="..." PropertyOperation="Deleted">
    <tt:Source>
      <tt:SimpleItem Name="Token" Value="audio" />
    </tt:Source>
    <tt:Data>
      <tt:SimpleItem Name="Sessions" Value="" />
    </tt:Data>
  </tt:Message>
</wsnt:Message>
]]></programlisting>
      </section>
	    <section>
        <title>Audio Clip State</title>
        <para>A device that supports AudioClipCapabilities in the GetServiceCapabilities response should generate an audio clip start event when an audio clip starts playing on the device and generate an audio clip stop event when the audio clip stops playing.Token and ClipName parameters can be empty if no audio clip has either started or stopped since the device was last booted.</para>
        <programlisting><![CDATA[Topic: tns1:Media/AudioClip/State
<tt:MessageDescription  IsProperty="true">
  <tt:Source>	
	<tt:SimpleItemDescription Name="AudioOutputToken" Type="tt:ReferenceToken"/>
  </tt:Source>
  <tt:Data>
    <tt:SimpleItemDescription Name="Token" Type="tt:ReferenceToken"/>
	<tt:SimpleItemDescription Name="ClipName" Type="xs:string"/>
	<tt:SimpleItemDescription Name="Playing" Type="xs:boolean"/>	
  </tt:Data>
</tt:MessageDescription>]]></programlisting>
		<para>The "Playing" parameter value is set to true for the audio clip start event and set to false for the audio clip stop event.</para>
      </section>
    </section>
  </chapter>
  <appendix xml:id="_Ref425842742">
    <title>Efficient XML Interchange (EXI) (Normative)</title>
    <para>EXI encoding allows for a more compact representation of XML metadata. Provision is signaled if the CompressionType returned via GetMetadataConfigurationOptions contains "EXI". <phrase>The ONVIF defined EXI configuration (see </phrase><xref linkend="_exiHdr" /><phrase> and </phrase><xref linkend="_Ref425842707" /><phrase>) shall be supported by all devices signaling support for EXI compression.</phrase>   The EXI header shall only be transmitted if a setting different then the ONVIF defined configuration is used. Except for the setting of the two elements “Presence Bit” and “EXI Options” the ONVIF defined EXI header settings (see <xref linkend="_exiHdr" /><phrase>) shall always be used.</phrase></para>
    <table xml:id="_exiHdr">
      <title>ONVIF defined EXI header settings</title>
      <tgroup cols="2">
        <colspec colname="c1" colwidth="33*" />
        <colspec colname="c2" colwidth="67*" />
        <thead>
          <row>
            <entry valign="middle">
              <para>Exi header element</para>
            </entry>
            <entry valign="middle">
              <para>Value</para>
            </entry>
          </row>
        </thead>
        <tbody valign="top">
          <row>
            <entry>
              <para>EXI Cookie</para>
            </entry>
            <entry>
              <para>mandatory</para>
            </entry>
          </row>
          <row>
            <entry>
              <para>Distinguishing Bits</para>
            </entry>
            <entry>
              <para>mandatory</para>
            </entry>
          </row>
          <row>
            <entry>
              <para>EXI Format Version</para>
            </entry>
            <entry>
              <para>0 0000</para>
            </entry>
          </row>
          <row>
            <entry>
              <para>Presence Bit for EXI Options</para>
            </entry>
            <entry>
              <para>0</para>
            </entry>
          </row>
          <row>
            <entry>
              <para>Exi Options</para>
            </entry>
            <entry>
              <para>
                <phrase>see </phrase>
                <xref linkend="_Ref425842707" />
              </para>
            </entry>
          </row>
          <row>
            <entry>
              <para>Padding Bits </para>
            </entry>
            <entry>
              <para>If present must be “0“.</para>
            </entry>
          </row>
        </tbody>
      </tgroup>
    </table>
    <table xml:id="_Ref425842707">
      <title>ONVIF defined EXI configuration settings</title>
      <tgroup cols="2">
        <colspec colname="c1" colwidth="34*" />
        <colspec colname="c2" colwidth="66*" />
        <thead>
          <row>
            <entry valign="middle">
              <para>Exi Option</para>
            </entry>
            <entry valign="middle">
              <para>Value</para>
            </entry>
          </row>
        </thead>
        <tbody valign="top">
          <row>
            <entry>
              <para>alignment</para>
            </entry>
            <entry>
              <para>default (bit-packed)</para>
            </entry>
          </row>
          <row>
            <entry>
              <para>compression</para>
            </entry>
            <entry>
              <para>default (false)</para>
            </entry>
          </row>
          <row>
            <entry>
              <para>strict</para>
            </entry>
            <entry>
              <para>default (false)</para>
            </entry>
          </row>
          <row>
            <entry>
              <para>fragment</para>
            </entry>
            <entry>
              <para>default (false)</para>
            </entry>
          </row>
          <row>
            <entry>
              <para>preserve</para>
            </entry>
            <entry>
              <para>default (all false)</para>
            </entry>
          </row>
          <row>
            <entry>
              <para>selfContained</para>
            </entry>
            <entry>
              <para>default (false)</para>
            </entry>
          </row>
          <row>
            <entry>
              <para>schemaID</para>
            </entry>
            <entry>
              <para>Insert reference to schema obtained from device here.</para>
            </entry>
          </row>
          <row>
            <entry>
              <para>datatypeRepresentationMap</para>
            </entry>
            <entry>
              <para>none</para>
            </entry>
          </row>
          <row>
            <entry>
              <para>blockSize</para>
            </entry>
            <entry>
              <para>
                <phrase>default (</phrase>1,000,000)</para>
            </entry>
          </row>
          <row>
            <entry>
              <para>valueMaxLength</para>
            </entry>
            <entry>
              <para>default (unbounded)</para>
            </entry>
          </row>
          <row>
            <entry>
              <para>valuePartitionCapacity</para>
            </entry>
            <entry>
              <para>default (unbounded)</para>
            </entry>
          </row>
          <row>
            <entry>
              <para>user defined meta-data</para>
            </entry>
            <entry>
              <para>none</para>
            </entry>
          </row>
        </tbody>
      </tgroup>
    </table>
  </appendix>
  <appendix xml:id="_Ref425846456">
    <title>Lens description (Normative)</title>
    <para>Wide angle lenses produce a geometrically distorted image. The lens description describes where an incoming light beam hits the image sensor. This allows clients to compensate the distortion. This specification describes only the mapping from incoming light beams to sensor location. The actual method of compensating the distortion can be freely chosen by the client and is outside of this specification.</para>
    <figure>
      <title>Optical mapping of angle (α) via radius (R) to normalized x/y coordinates</title>
      <mediaobject>
        <imageobject>
          <imagedata fileref="media/Media2/image5.png" contentwidth="147.54mm" />
        </imageobject>
      </mediaobject>
    </figure>
    <para>The lens projection function is defined <phrase>by a set of points. A smooth mapping is achieved by using </phrase>B-Spline approximation as shown in Figure B-2. </para>
    <figure>
      <title>Smooth mapping using B-Splines</title>
      <mediaobject>
        <imageobject>
          <imagedata fileref="media/Media2/image6.jpeg" contentwidth="158.12mm" />
        </imageobject>
      </mediaobject>
    </figure>
    <para>Lens to imager axis offsets can be described via the so-called LensOffset. Figure B-3 depicts that the compensation of a vertical offset results in a shift of the spline curve.</para>
    <figure>
      <title>Compensation of vertical axis offset</title>
      <mediaobject>
        <imageobject>
          <imagedata fileref="media/Media2/image7.jpeg" contentwidth="157.85mm" />
        </imageobject>
      </mediaobject>
    </figure>
  </appendix>
  <appendix role="revhistory">
    <title>Revision History</title>
    <para />
  </appendix>
</book>
