<?xml version="1.0"?>
<?xml-stylesheet href="docbook.xsl" type="text/xsl" ?>
<book xmlns="http://docbook.org/ns/docbook" version="5.0">
  <info>
    <title>Imaging Service Specification</title>
    <titleabbrev>Imaging</titleabbrev>
    <releaseinfo>22.06</releaseinfo>
    <author>
      <orgname>ONVIF™</orgname>
      <uri>www.onvif.org</uri>
    </author>
    <pubdate>June, 2022</pubdate>
    <mediaobject>
      <imageobject>
        <imagedata fileref="media/logo.png" contentwidth="60mm" />
      </imageobject>
    </mediaobject>
    <copyright>
      <year>2008-2022</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>2.1</revnumber>
        <date>Jul-2011</date>
        <author>
          <personname>Hans Busch</personname>
        </author>
        <revremark>Split from Core 2.0 without change of content.</revremark>
      </revision>
      <revision>
        <revnumber>2.1.1</revnumber>
        <date>Jan-2012</date>
        <author>
          <personname>Hans Busch</personname>
        </author>
        <revremark>Change Requests 535</revremark>
      </revision>
      <revision>
        <revnumber>2.2</revnumber>
        <date>Feb-2012</date>
        <author>
          <personname>Takahiro Iwasaki</personname>
        </author>
        <revremark>Addition of Image Stabilization and  events
Change Requests 654, 662, 664, 665</revremark>
      </revision>
      <revision>
        <revnumber>2.2.1</revnumber>
        <date>Dec-2012</date>
        <author>
          <personname>Hans Busch</personname>
        </author>
        <revremark>Change Request 708, 709</revremark>
      </revision>
      <revision>
        <revnumber>2.4</revnumber>
        <date>Mar-2013</date>
        <author>
          <personname>Takahiro Iwasaki</personname>
        </author>
        <revremark>Addition of IRCF Auto Adjustment parameters</revremark>
      </revision>
      <revision>
        <revnumber>2.5</revnumber>
        <date>Dec-2014</date>
        <author>
          <personname>Takahiro Iwasaki Norio Ishibashi</personname>
        </author>
        <author>
          <personname>Hiroyuki Sano</personname>
        </author>
        <revremark>Addition of ToneCompensation, Defogging and NoiseReduction parameters.</revremark>
      </revision>
      <revision>
        <revnumber>2.6.1</revnumber>
        <date>Dec-2015</date>
        <author>
          <personname>Hans Busch</personname>
        </author>
        <revremark>Change Request 1730</revremark>
      </revision>
      <revision>
        <revnumber>16.06</revnumber>
        <date>Jun-2016</date>
        <author>
          <personname>Arsenio Vilallonga</personname>
        </author>
        <author>
          <personname>Hiroyuki Sano</personname>
        </author>
        <revremark>Added Imaging Presets
Change Request 1851</revremark>
      </revision>
      <revision>
        <revnumber>17.06</revnumber>
        <date>Jan-2017</date>
        <author>
          <personname>Hans Busch</personname>
        </author>
        <revremark>Updated method layouts.
Change Request 1843</revremark>
      </revision>
      <revision>
        <revnumber>18.12</revnumber>
        <date>Dec-2018</date>
        <author>
          <personname>Hiroyuki Sano</personname>
        </author>
        <revremark>Change Request 2361</revremark>
      </revision>
      <revision>
        <revnumber>19.06</revnumber>
        <date>Jun-2019</date>
        <author>
          <personname>Hans Busch</personname>
        </author>
        <author>
          <personname>Hiroyuki Sano</personname>
        </author>
        <revremark>Added Focus Modes
Change Request 2384, 2431, 2477, 2478</revremark>
      </revision>
      <revision>
        <revnumber>22.06</revnumber>
        <date>June-2022</date>
        <author>
          <personname>Fredrik Svensson</personname>
        </author>
        <revremark>Change the "role" attribute for request access class.</revremark>
      </revision>
    </revhistory>
  </info>
  <chapter>
    <title>Scope </title>
    <para>This document defines the web service interface for configuring imaging related aspects of a camera. </para>
  </chapter>
  <chapter>
    <title>Normative references</title>
    <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">http://www.onvif.org/onvif/specs/core/ONVIF-Core-Specification.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">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 align="left">
                <para>
                  <emphasis role="bold">Imaging Service</emphasis>
                </para>
              </entry>
              <entry align="left">
                <para>Services for exposure time, gain and white balance parameters among others.</para>
              </entry>
            </row>
            <row>
              <entry align="left">
                <para>
                  <emphasis role="bold">Input/Output (I/O)</emphasis>
                </para>
              </entry>
              <entry align="left">
                <para>Currently relay ports and video/audio inputs/outputs are handled.</para>
              </entry>
            </row>
            <row>
              <entry align="left">
                <para>
                  <emphasis role="bold">Optical Zoom</emphasis>
                </para>
              </entry>
              <entry align="left">
                <para>Changes the focal length (angle of view) for the device by moving the zoom lens in the camera’s optics.</para>
              </entry>
            </row>
            <row>
              <entry align="left">
                <para>
                  <emphasis role="bold">Image Stabilization</emphasis>
                </para>
              </entry>
              <entry align="left">
                <para>Functionality used to avoid blurring of images due to movement of the device or its objects.</para>
              </entry>
            </row>
            <row>
              <entry align="left">
                <para>
                  <emphasis role="bold">Tone Compensation</emphasis>
                </para>
              </entry>
              <entry align="left">
                <para>Functionality used to make the image with dark or bright areas to be more visible.</para>
              </entry>
            </row>
            <row>
              <entry align="left">
                <para>
                  <emphasis role="bold">Defogging</emphasis>
                </para>
              </entry>
              <entry align="left">
                <para>Functionality used to make the image more detailed in presence of fog.</para>
              </entry>
            </row>
            <row>
              <entry align="left">
                <para>
                  <emphasis role="bold">Imaging Preset</emphasis>
                </para>
              </entry>
              <entry align="left">
                <para>Functionality offered by Imaging device manufacturers as a tool to ease Image Setting adjustment for a given set of standard scene types.</para>
              </entry>
            </row>
          </tbody>
        </tgroup>
      </informaltable>
    </section>
  </chapter>
  <chapter>
    <title>Overview</title>
    <para>The imaging service provides configuration and control data for imaging specific properties. WSDL is part of the framework and provided in the Imaging WSDL file.</para>
    <para>The service includes the following operations:</para>
    <itemizedlist>
      <listitem>
        <para>Get and set imaging configurations (exposure time, gain and white balance, for example).</para>
      </listitem>
      <listitem>
        <para>Get imaging configuration options (valid ranges for imaging parameters).</para>
      </listitem>
      <listitem>
        <para>Move focus lens including position and move status retrieval.</para>
      </listitem>
      <listitem>
        <para>Imaging Presets</para>
      </listitem>
    </itemizedlist>
    <para>WSDL for this service is specified in <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.onvif.org/ver20/imaging/wsdl/imaging.wsdl">http://www.onvif.org/ver20/imaging/wsdl/imaging.wsdl</link>.</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>timg</para>
            </entry>
            <entry>
              <para>http://www.onvif.org/ver20/imaging/wsdl</para>
            </entry>
          </row>
          <row>
            <entry>
              <para>tns1</para>
            </entry>
            <entry>
              <para>http://www.onvif.org/ver10/topics</para>
            </entry>
          </row>
        </tbody>
      </tgroup>
    </table>
  </chapter>
  <chapter>
    <title>Service</title>
    <para>The imaging service provides operations used to control and configure imaging properties on a device. A device that has one or more video sources should support the imaging service as defined in [ONVIF Imaging WSDL]. The imaging settings are part of the VideoSource entity. This means that imaging parameters directly affect a specific video source. </para>
    <section>
      <title>Imaging settings</title>
      <section xml:id="_Ref470245946">
        <title>Parameters</title>
        <para>The imaging service provides operations to get or set imaging parameters and the valid ranges for those parameters. Some parameters have no effect if a specific mode is not set. Some of the parameters included in the settings require a specific imaging capability that can be requested through the GetOptions command. The following settings are available through the imaging service operations:</para>
        <para>
          <emphasis role="bold">BacklightCompensation:</emphasis> Enables/disables BLC mode (on/off)</para>
        <itemizedlist>
          <listitem>
            <para>On</para>
            <itemizedlist>
              <listitem>
                <para>Optional level parameter (unspecified unit).</para>
              </listitem>
            </itemizedlist>
          </listitem>
          <listitem>
            <para>Off</para>
          </listitem>
        </itemizedlist>
        <para>
          <emphasis role="bold">Brightness:</emphasis> Adjusts the image brightness (unspecified unit).</para>
        <para>
          <emphasis role="bold">ColorSaturation:</emphasis> Adjusts the color saturation in the image (unspecified unit).</para>
        <para>
          <emphasis role="bold">Sharpness: </emphasis>Adjusts the sharpness in the image (unspecified unit).</para>
        <para>
          <emphasis role="bold">Contrast:</emphasis> Adjusts the image contrast (unspecified unit).</para>
        <para>
          <emphasis role="bold">Exposure:</emphasis>
        </para>
        <itemizedlist>
          <listitem>
            <para>Auto – Enables the exposure algorithm on the device:</para>
            <itemizedlist>
              <listitem>
                <para>Priority – Sets the exposure priority mode (low noise/framerate).</para>
              </listitem>
              <listitem>
                <para>Window – Rectangular exposure mask.</para>
              </listitem>
              <listitem>
                <para>Min/MaxExposureTime – Exposure time range allowed to be used by the algorithm.</para>
              </listitem>
              <listitem>
                <para>Min/MaxGain – The sensor gain range that is allowed to be used by the algorithm.</para>
              </listitem>
              <listitem>
                <para>Min/MaxIris – The iris range allowed to be used by the algorithm. 0dB maps to a fully opened iris and positive values map to higher attenuation.</para>
              </listitem>
            </itemizedlist>
          </listitem>
          <listitem>
            <para>Manual – Disables the exposure algorithm on the device:</para>
            <itemizedlist>
              <listitem>
                <para>ExposureTime – The fixed exposure time used by the image sensor (μs).</para>
              </listitem>
              <listitem>
                <para>Gain – The fixed gain used by the image sensor (dB).</para>
              </listitem>
              <listitem>
                <para>Iris – The fixed attenuation of input light affected by the iris (dB). 0dB maps to a fully opened iris and positive values map to higher attenuation.</para>
              </listitem>
            </itemizedlist>
          </listitem>
        </itemizedlist>
        <para>
          <emphasis role="bold">Focus:</emphasis>
        </para>
        <itemizedlist>
          <listitem>
            <para>Auto (parameters that apply to automatic mode only):</para>
            <itemizedlist>
              <listitem>
                <para>Near/FarLimit – Limits for focus lens (m).</para>
              </listitem>
              <listitem>
                <para>AFMode:</para>
                <itemizedlist>
                  <listitem>
                    <para>OnceAfterMove – The auto focus unit adjusts only once after a pan, tilt or zoom operation stops.</para>
                  </listitem>
                </itemizedlist>
              </listitem>
            </itemizedlist>
          </listitem>
          <listitem>
            <para>Manual (parameters that apply to manual mode only):</para>
            <itemizedlist>
              <listitem>
                <para>Default speed – The default speed for focus move operation (when the speed parameter not is present). Manual control is done through the move command, see Section <xref linkend="_Ref525653465" />.</para>
              </listitem>
            </itemizedlist>
          </listitem>
        </itemizedlist>
        <para>
          <emphasis role="bold">IrCutFilter: </emphasis>Toggles the IR cut filter state between on, off and auto. The auto state lets the exposure algorithm handle when the Ir cut filter should be turned on or off. </para>
        <itemizedlist>
          <listitem>
            <para>On: Enable IR cut fiter. Typically day mode.</para>
          </listitem>
          <listitem>
            <para>Off: Disable IR cut filter. Typically night mode.</para>
          </listitem>
          <listitem>
            <para>Auto: Ir cut filter is automatically activated by the device. </para>
          </listitem>
        </itemizedlist>
        <para>
          <emphasis role="bold">IrCutFilterAutoAdjustment:</emphasis> Optional parameters applied to only auto mode to adjust timing of toggling Ir cut filter </para>
        <itemizedlist>
          <listitem>
            <para>BoundaryType – Specifies which boundaries to automatically toggle IR cut filter following parameters are applied to:</para>
            <itemizedlist>
              <listitem>
                <para>Common: Applied to both boundaries automatically toggling IR cut filter on and off</para>
              </listitem>
              <listitem>
                <para>ToOn/ToOff: Applied individually to one of the boundaries automatically toggling IR cut filter to on/off</para>
              </listitem>
            </itemizedlist>
          </listitem>
          <listitem>
            <para>BoundaryOffset – Adjusts boundary exposure level for toggling Ir cut filter to on/off specified with unitless normalized value from +1.0 to -1.0. Zero is default and -1.0 is the darkest adjustment (Unitless).</para>
          </listitem>
          <listitem>
            <para>ResponseTime – Delay time of toggling Ir cut filter to on/off after crossing of the boundary exposure levels<emphasis role="bold"></emphasis></para>
          </listitem>
        </itemizedlist>
        <para>
          <emphasis role="bold">Whitebalance:</emphasis>
        </para>
        <itemizedlist>
          <listitem>
            <para>Auto whitebalancing mode (auto/manual).</para>
          </listitem>
          <listitem>
            <para>Manual (parameters that apply to manual mode only):</para>
            <itemizedlist>
              <listitem>
                <para>Rgain (unitless).</para>
              </listitem>
              <listitem>
                <para>Bgain (unitless).</para>
              </listitem>
            </itemizedlist>
          </listitem>
        </itemizedlist>
        <para>
          <emphasis role="bold">WideDynamicRange:</emphasis> Wide dynamic range (on/off):</para>
        <itemizedlist>
          <listitem>
            <para>On</para>
            <itemizedlist>
              <listitem>
                <para>Optional level parameter (unitless).</para>
              </listitem>
            </itemizedlist>
          </listitem>
          <listitem>
            <para>Off</para>
          </listitem>
        </itemizedlist>
        <para>
          <emphasis role="bold">Image Stabilization</emphasis>: Enables/disables Image Stabilization feature (on/off/auto):</para>
        <itemizedlist>
          <listitem>
            <para>On: Enable Image Stabilization feature.</para>
            <itemizedlist>
              <listitem>
                <para>Optional level parameter (unspecified unit).</para>
              </listitem>
            </itemizedlist>
          </listitem>
          <listitem>
            <para>Off: Disable Image Stabilization feature</para>
          </listitem>
          <listitem>
            <para>Auto: Image Stabilization feature is automatically activated by the device</para>
          </listitem>
        </itemizedlist>
        <para>
          <emphasis role="bold">ToneCompensation:</emphasis> Enables/disables Tone Compensation mode. </para>
        <itemizedlist>
          <listitem>
            <para>On: Enable Tone Compensation feature.</para>
            <itemizedlist>
              <listitem>
                <para>Optional level parameter – Optional level parameter to adjust level of compensation specified with normalized value from 0.0 to +1.0 (Unitless). </para>
              </listitem>
            </itemizedlist>
          </listitem>
          <listitem>
            <para>Off: Disable Tone Compensation feature.</para>
          </listitem>
          <listitem>
            <para>Auto: Enable Tone Compansation feature with adjusting level automatically.</para>
          </listitem>
        </itemizedlist>
        <para>
          <emphasis role="bold">Defogging:</emphasis> Enables/disables Defogging function. </para>
        <itemizedlist>
          <listitem>
            <para>On: Enable Defogging feature.</para>
            <itemizedlist>
              <listitem>
                <para>Optional level parameter – Optional level parameter to adjust level of compensation specified with normalized value from 0.0 to +1.0 (Unitless). </para>
              </listitem>
            </itemizedlist>
          </listitem>
          <listitem>
            <para>Off: Disable Defogging feature.</para>
          </listitem>
          <listitem>
            <para>Auto: Enable Defogging feature with adjusting level automatically.</para>
          </listitem>
        </itemizedlist>
        <para>
          <emphasis role="bold">Noise Reduction:</emphasis> Adjusts the noise reduction level in the image with normalized value from 0.0 to +1.0 (unitless). Level=0 means no noise reduction or minimal noise reduction.</para>
      </section>
      <section>
        <title> GetImagingSettings</title>
        <para>This operation requests the imaging setting for a video source on the device. A device implementing the imaging service shall support this command.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">VideoSourceToken [tt:ReferenceToken] </para>
              <para role="text">Reference to the video source for which  the imaging settings are requested</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">ImagingSettings [tt:ImagingSettings20] </para>
              <para role="text">Imaging settings for the video source as defined in section 5.1.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - terNoSource</para>
              <para role="text">The requested VideoSource does not exist.</para>
              <para role="param">env:Receiver - ter:ActionNotSupported - ter:NoImagingForSource</para>
              <para role="text">The requested video source does not support imaging settings.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">READ_MEDIA</para>
            </listitem>
          </varlistentry>
        </variablelist>
        <para>If the video source supports any of the imaging settings as defined by the ImagingSettings type in the [ONVIF Schema], then it should be possible to retrieve the imaging settings from the device through the GetImagingSettings command.</para>
      </section>
      <section xml:id="_Toc86847688">
        <title>SetImagingSettings</title>
        <para>This operation sets the imaging settings for a video source on a device. A device implementing the imaging service shall support this command.  </para>
        <para>A device indicating support for the AdaptablePreset capability shall apply the same settings to the current active preset, see <xref linkend="_Toc214944255" />.</para>
        <para>The possible configurable imaging settings parameters are described in section <xref linkend="_Ref470245946" />. Settings options are obtained through the command defined in section <xref linkend="_Toc86847689" /></para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">VideoSourceToken [tt:ReferenceToken]</para>
              <para role="text">Reference to the VideoSource</para>
              <para role="param">ImagingSettings [tt:ImagingSettings20]</para>
              <para role="text">The imaging settings to be applied</para>
              <para role="param">ForcePersistence - optional [xs:boolean]</para>
              <para role="text">Deprecated indication whether the configuration persists after reboot.</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 - terNoSource</para>
              <para role="text">The requested VideoSource does not exist.</para>
              <para role="param">env:Receiver - ter:ActionNotSupported- terNoImagingForSource</para>
              <para role="text">The requested VideoSource does not support imaging settings.</para>
              <para role="param">env:Sender - ter:InvalidArgVal - terSettingsInvalid</para>
              <para role="text">The requested settings are incorrect.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">ACTUATE</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section xml:id="_Toc86847689">
        <title>GetOptions</title>
        <para>This operation gets the valid ranges for the imaging parameters that have device specific ranges. A device implementing the imaging service shall support this command. The command shall return all supported parameters and their ranges such that these can be applied to the SetImagingSettings command.</para>
        <para>For read-only parameters which cannot be modified via the SetImagingSettings command only a single option or identical Min and Max values shall be provided. </para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">VideoSourceToken [tt:ReferenceToken]</para>
              <para role="text">Reference to the VideoSource</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">ImagingOptions [tt:ImagingOptions20]</para>
              <para role="text">Valid ranges for the imaging parameters that are categorized as device specific.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - terNoSource</para>
              <para role="text">The requested VideoSource does not exist.</para>
              <para role="param">env:Receiver - ter:ActionNotSupported- terNoImagingForSource</para>
              <para role="text">The requested VideoSource does not support imaging settings.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">READ_MEDIA</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
    </section>
    <section xml:id="_Toc214944255">
      <title>Imaging Presets</title>
      <para>video source manufacturers can offer pre-set imaging configurations, which contain different parameter settings, tuned for optimum imaging performance under given scene circumstances. The Imaging Presets functionality is similar in function to what compact photography cameras offer today to the non-professional user, in order to easily be able to obtain optimum pictures under given scene conditions (e.g. Portrait, Landscape, Sports, Macro, Silhouette).</para>
      <para>Three commands enable the use of Imaging Presets.</para>
      <section>
        <title>GetPresets</title>
        <para>The GetPresets command requests the current predefined list of Imaging Settings (Presets) offered by the manufacturer for a given video source.</para>
        <para>The output is a list containing the available Imaging Presets.</para>
        <para>A device indicating the ImagingPresets capability shall support this command.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">VideoSourceToken</para>
              <para role="text">Reference token to VideoSource for which the available Imaging Presets should be requested.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">Preset - unbounded [timg:ImagingPreset]</para>
              <para role="text">The available list of imaging presets supported by the device. Any device with Imaging Presets capability shall offer at least one Imaging Preset. </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - terNoSource</para>
              <para role="text">The requested VideoSource does not exist.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">READ_MEDIA</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section>
        <title>GetCurrentPreset</title>
        <para>The GetCurrentPreset command shall request the Imaging Preset which is currently applied to the specified video source, i.e. it shall request which of the predefined set of Imaging Settings (and/or Thermal Settings) was last applied to the video source. The output is the current Imaging Preset.</para>
        <para>If the video source configuration does not match any of the existing Imaging Presets, the output of GetCurrentPreset shall be Empty.</para>
        <para>A device indicating the ImagingPresets capability shall support this command.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">VideoSourceToken [tt:ReferenceToken]</para>
              <para role="text">Reference token to VideoSource for which the available Imaging Presets should be requested.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">CurrentPreset - unbounded [timg:ImagingPreset]</para>
              <para role="text">The current (i.e. last applied) Imaging Preset applied to the specified video source. Return is empty if no capability or if current configuration does not match any existing Imaging Preset.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - terNoSource</para>
              <para role="text">The requested VideoSource does not exist.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">READ_MEDIA</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section>
        <title>SetCurrentPreset</title>
        <para>The SetCurrentPreset command shall request a given Imaging Preset to be applied to the specified video source. </para>
        <para>A device indicating the ImagingPresets capability shall support this command.</para>
        <para>Imaging Presets are defined by the Manufacturer, and offered as a tool to simplify Imaging Settings adjustments for specific scene patterns. When the new Imaging Preset is applied by SetCurrentPreset, as a response, the device shall adjust the video source settings to match those values defined by the specified Imaging Preset. </para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">VideoSourceToken [tt:ReferenceToken]</para>
              <para role="text">Reference token to VideoSource for which the Imaging Presets should be set</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 - terNoSource</para>
              <para role="text">The requested VideoSource does not exist.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">ACTUATE</para>
            </listitem>
          </varlistentry>
        </variablelist>
        <itemizedlist>
          <listitem>
            <para>PresetToken [tt:ReferenceToken]</para>
            <para>Preset to be applied.</para>
          </listitem>
        </itemizedlist>
      </section>
    </section>
    <section>
      <title>Focus operations</title>
      <section xml:id="_Ref525653465">
        <title>Move</title>
        <para>The move command moves the focus lens in an absolute, a relative or in a continuous manner from its current position. The speed argument is optional for absolute and relative control, but required for continuous. If no speed argument is used, the default speed is used. Focus adjustments through this operation will turn off the autofocus. A device with support for remote focus control should support absolute, relative or continuous control through the Move operation. The supported MoveOpions are signalled via the GetMoveOptions command.</para>
        <para>At least one focus control capability is required for this operation to be functional.</para>
        <para>The move operation contains the following commands:</para>
        <para>
          <emphasis role="bold">Absolute</emphasis> – Requires position parameter and optionally takes a speed argument. A unitless type is used by default for focus positioning and speed. Optionally, if supported, the position may be requested in m<superscript>-1 </superscript>units. </para>
        <para>
          <emphasis role="bold">Relative</emphasis> – Requires distance parameter and optionally takes a speed argument. Negative distance means negative direction. </para>
        <para>
          <emphasis role="bold">Continuous</emphasis> – Requires a speed argument. Negative speed argument means negative direction.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">VideoSourceToken [tt:ReferenceToken]</para>
              <para role="text">Reference token to the VideoSource.</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 - terNoSource</para>
              <para role="text">The requested VideoSource does not exist.</para>
              <para role="param">env:Receiver - ter:ActionNotSupported- terNoImagingForSource</para>
              <para role="text">The requested VideoSource does not support imaging settings.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">ACTUATE</para>
            </listitem>
          </varlistentry>
        </variablelist>
        <itemizedlist>
          <listitem>
            <para>Focus [tt:FocusMove]</para>
            <para>Focal  operation.</para>
          </listitem>
        </itemizedlist>
      </section>
      <section>
        <title>GetMoveOptions</title>
        <para>The GetMoveOptions command retrieves the focus lens move options to be used in the move command as defined in Section <xref linkend="_Ref525653465" />. A device that supports the imaging service shall support the GetMoveOptions command. The response to the command shall include all supported Move Operations. If focus move is not supported at all, the reponse shall be empty.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">VideoSourceToken [tt:ReferenceToken]</para>
              <para role="text">Reference token to VideoSource.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">MoveOptions [tt:MoveOptions20]</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - terNoSource</para>
              <para role="text">The requested VideoSource does not exist.</para>
              <para role="param">env:Receiver - ter:ActionNotSupported- terNoImagingForSource</para>
              <para role="text">The requested VideoSource does not support imaging settings.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">READ_MEDIA</para>
            </listitem>
          </varlistentry>
        </variablelist>
        <para>The valid ranges for the focus lens move command.</para>
      </section>
      <section>
        <title>Stop</title>
        <para>The Stop command stops all ongoing focus movements of the lense. A device with support for remote focus control as signalled via the GetMoveOptions should support this command. The operation will not affect ongoing autofocus operation.</para>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">VideoSourceToken [tt:ReferenceToken]</para>
              <para role="text">Reference token to the VideoSource.</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 - terNoSource</para>
              <para role="text">The requested VideoSource does not exist.</para>
              <para role="param">env:Receiver - ter:ActionNotSupported- terNoImagingForSource</para>
              <para role="text">The requested VideoSource does not support imaging settings.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">ACTUATE</para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section>
        <title>GetStatus</title>
        <para>The GetStatus command requests the current imaging status from the device. A device with support for remote focus control as signaled via the GetMoveOptions shall support this command.</para>
        <para>The imaging status contains:</para>
        <itemizedlist>
          <listitem>
            <para>Focus position, move status and error information.</para>
            <itemizedlist>
              <listitem>
                <para>The focus position is represented in a unitless type.</para>
              </listitem>
              <listitem>
                <para>Move status may be in a MOVING, IDLE or UNKNOWN state.</para>
              </listitem>
              <listitem>
                <para>Error information provided as a string, for example a positioning error indicated by the hardware.</para>
              </listitem>
            </itemizedlist>
          </listitem>
        </itemizedlist>
        <variablelist role="op">
          <varlistentry>
            <term>request</term>
            <listitem>
              <para role="param">VideoSourceToken [tt:ReferenceToken]</para>
              <para role="text">Reference token to the VideoSource.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>response</term>
            <listitem>
              <para role="param">ImagingStatus [tt:ImagingStatus20]</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>faults</term>
            <listitem>
              <para role="param">env:Sender - ter:InvalidArgVal - terNoSource</para>
              <para role="text">The requested VideoSource does not exist.</para>
              <para role="param">env:Receiver - ter:ActionNotSupported- terNoImagingForSource</para>
              <para role="text">The requested VideoSource does not support imaging settings.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>access class</term>
            <listitem>
              <para role="access">READ_MEDIA</para>
            </listitem>
          </varlistentry>
        </variablelist>
        <para>The imaging status information.</para>
      </section>
    </section>
    <section>
      <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 message is empty</para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>response</term>
          <listitem>
            <para role="param">Capabilities [timg:Capabilities]</para>
            <para role="text">Set of indicators for function groups as described 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 capabilites are available:</para>
      <variablelist>
        <varlistentry>
          <term>ImageStabilization</term>
          <listitem><para>Indicates whether or not Image Stabilization feature is supported.
            The use of this capability is deprecated, a client should use GetOption to find out if image
            stabilization is supported.</para></listitem>
        </varlistentry>
        <varlistentry>
          <term>ImagingPresets</term>
          <listitem><para>Indicates support for imaging presets.</para></listitem>
        </varlistentry>
        <varlistentry>
          <term>AdaptablePreset</term>
          <listitem><para>Indicates whether imaging presets can be updated, see <xref linkend="_Toc86847688"/>.</para></listitem>
        </varlistentry>
      </variablelist>
    </section>
    <section>
      <title>Events</title>
      <para>The Message structure of these events is given by the following Message Description:</para>
      <programlisting><![CDATA[<tt:MessageDescription IsProperty="true">
  <tt:Source>
    <tt:SimpleItemDescription Name="Source" Type="tt:ReferenceToken"/>
  </tt:Source>
  <tt:Data>
    <tt:SimpleItemDescription Name="State" Type="xs:boolean"/>
  </tt:Data>
</tt:MessageDescription>
]]></programlisting>
      <para>The SourceToken points to the source the image is coming from. This is in case of the Analytics or Image Service a VideoSource token and in case of the Recording Service the Recording job token.</para>
      <section>
        <title>Tampering</title>
        <para>For video sources, Tamper Alarm situations are defined which indicate that the video camera is blended, covered, moved, or unplugged. </para>
        <para>The tampering could be detected be different services (e.g by the Imaging Service or the Analytics Service). Some clients may want to get the information which service detected the event. Therefore the topic is used to give this additional information. The following three services are defined as source, a device MAY add additional ones if necessary.</para>
        <section>
          <title>ImageTooBlurry</title>
          <para>When a camera is out-of-focus, such that important details are lost, the device should use the ImageTooBlurry notification in order to notify a client about the possible tampering if the device supports this feature.</para>
          <programlisting><![CDATA[tns1:VideoSource/ImageTooBlurry/AnalyticsService
tns1:VideoSource/ImageTooBlurry/ImagingService
tns1:VideoSource/ImageTooBlurry/RecordingService
]]></programlisting>
        </section>
        <section>
          <title>ImageTooDark</title>
          <para>When a camera is covered, such that the corresponding video signal becomes mostly black, the device should use the ImageTooDark notification in order to notify a client about the possible tampering if the device supports this feature.</para>
          <programlisting><![CDATA[tns1:VideoSource/ImageTooDark/AnalyticsService
tns1:VideoSource/ImageTooDark/ImagingService
tns1:VideoSource/ImageTooDark/RecordingService
]]></programlisting>
        </section>
        <section>
          <title>ImageTooBright</title>
          <para>When a camera is blended, such that the corresponding video signal becomes mostly white, the device should use the ImageTooBright notification in order to notify a client about the possible tampering if the device supports this feature.</para>
          <programlisting><![CDATA[tns1:VideoSource/ImageTooBright/AnalyticsService
tns1:VideoSource/ImageTooBright/ImagingService
tns1:VideoSource/ImageTooBright/RecordingService
]]></programlisting>
        </section>
        <section>
          <title>GlobalSceneChange</title>
          <para>When a large portion of the video content changes, the cause can be tamper actions like camera movement or coverage. If this feature is supported by the device it should notify the client using the following event:</para>
          <programlisting><![CDATA[tns1:VideoSource/GlobalSceneChange/AnalyticsService
tns1:VideoSource/GlobalSceneChange/ImagingService
tns1:VideoSource/GlobalSceneChange/RecordingService
]]></programlisting>
        </section>
        <section>
          <title>SignalLoss</title>
          <para>For devices having an analog input source, cutting the analog line between device and camera is a possible tampering which results in video Loss. A device that supports this feature shouldprovide the following event:</para>
          <programlisting><![CDATA[tns1:VideoSource/SignalLoss
]]></programlisting>
        </section>
      </section>
      <section>
        <title>MotionAlarm</title>
        <para>When a device detects motion (e.g by an Analytics Service) it can inform a client using this event. This event is a basic motion alarm event that should be supported by all devices that support motion detection. If a device has a more complex algorithm running, it is free to provide a vendor specific motion alarm event. If the device supports motion detection, it should provide the following event. </para>
        <programlisting><![CDATA[tns1:VideoSource/MotionAlarm
]]></programlisting>
      </section>
    </section>
  </chapter>
  <appendix role="revhistory">
    <title>Revision History</title>
    <para />
  </appendix>
</book>
