-
Notifications
You must be signed in to change notification settings - Fork 120
Expand file tree
/
Copy pathRecordingControl.xml
More file actions
2597 lines (2590 loc) · 136 KB
/
RecordingControl.xml
File metadata and controls
2597 lines (2590 loc) · 136 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0"?>
<?xml-stylesheet href="docbook.xsl" type="text/xsl" ?>
<book xmlns="http://docbook.org/ns/docbook" version="5.0">
<info>
<title>ONVIF Recording Control Service Specification</title>
<titleabbrev>RecordingControl</titleabbrev>
<releaseinfo>24.12</releaseinfo>
<author>
<orgname>ONVIF™</orgname>
<uri>www.onvif.org</uri>
</author>
<pubdate>December, 2024</pubdate>
<mediaobject>
<imageobject>
<imagedata fileref="media/logo.png" contentwidth="60mm"/>
</imageobject>
</mediaobject>
<copyright>
<year>2008-2024</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 293, 297, 535</revremark>
</revision>
<revision>
<revnumber>2.2</revnumber>
<date>Apr-2012</date>
<author>
<personname>Hans Busch</personname>
</author>
<revremark>Change Requests 608, 625, 636, 673</revremark>
</revision>
<revision>
<revnumber>2.2.1</revnumber>
<date>Dec-2012</date>
<author>
<personname>Hans Busch</personname>
</author>
<author>
<personname>Michio Hirai</personname>
</author>
<revremark>Change Requests 708, 709, 719, 759, 827, 845, 852, 866, 867, 870, 862, 872, 861</revremark>
</revision>
<revision>
<revnumber>2.3</revnumber>
<date>May-2013</date>
<author>
<personname>Michio Hirai</personname>
</author>
<revremark>Change Request 934</revremark>
</revision>
<revision>
<revnumber>2.4</revnumber>
<date>Aug-2013</date>
<author>
<personname>Michio Hirai</personname>
</author>
<revremark>Change Request 1073, 1086</revremark>
</revision>
<revision>
<revnumber>2.4.1</revnumber>
<date>Dec-2013</date>
<author>
<personname>Michio Hirai</personname>
</author>
<revremark>Change Request 1148, 1189</revremark>
</revision>
<revision>
<revnumber>2.4.2</revnumber>
<date>Jun-2014</date>
<author>
<personname>Michio Hirai</personname>
</author>
<revremark>Change Request 1292, 1298, 1304, 1412</revremark>
</revision>
<revision>
<revnumber>2.5</revnumber>
<date>Dec-2014</date>
<author>
<personname>Hasan Timucin Ozdemir</personname>
</author>
<revremark>Added 5.21 ExportRecordedData command and corresponding capability flag in 5.24 Capabilitites
Added 5.22 StopExportRecordedData
Added 5.23 GetExportRecordedDataStatus</revremark>
</revision>
<revision>
<revnumber>16.12</revnumber>
<date>Dec-2016</date>
<author>
<personname>Hans Busch</personname>
</author>
<revremark>Change Request 1991</revremark>
</revision>
<revision>
<revnumber>17.06</revnumber>
<date>Jun-2017</date>
<author>
<personname>Stefan Andersson</personname>
</author>
<author>
<personname>Hiroyuki Sano</personname>
</author>
<revremark>Update method layouts
Change Request 1843, 2060, 2062
Change Request 2061, 2063, 2065, 2109</revremark>
</revision>
<revision>
<revnumber>17.12</revnumber>
<date>Dec-2017</date>
<author>
<personname>Hiroyuki Sano</personname>
</author>
<revremark>Change Request 2178, 2179, 2185</revremark>
</revision>
<revision>
<revnumber>18.06</revnumber>
<date>Jun-2018</date>
<author>
<personname>Hiroyuki Sano</personname>
</author>
<revremark>Change Request 2230, 2258</revremark>
</revision>
<revision>
<revnumber>19.06</revnumber>
<date>Jun-2019</date>
<author>
<personname>Hans Busch</personname>
</author>
<revremark>Added Scheduled Recording</revremark>
</revision>
<revision>
<revnumber>21.12</revnumber>
<date>Dec-2021</date>
<author>
<personname>Sergey Bogdanov</personname>
</author>
<revremark>Change the "role" attribute for request access class.</revremark>
</revision>
<revision>
<revnumber>22.12</revnumber>
<date>Dec-2022</date>
<author>
<personname>Hans Busch</personname>
</author>
<revremark>Add support for event recording.</revremark>
</revision>
<revision>
<revnumber>23.06</revnumber>
<date>Jun-2023</date>
<author>
<personname>Felix Schuetz</personname>
</author>
<revremark>Add annex on object storage recording.</revremark>
</revision>
<revision>
<revnumber>24.12</revnumber>
<date>Dec-2024</date>
<author>
<personname>Sriram Bhetanabottla</personname>
</author>
<revremark>Clarify delete interfaces for object storage.</revremark>
</revision>
</revhistory>
</info>
<chapter>
<title>Scope </title>
<para>This document defines the web service interface for the configuration of recording of Video, Audio and Metadata. Additionally associated events are defined.</para>
<para>The overview section provides a definition of the ONVIF storage model. This is common for all ONVIF storage related services.</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 role="reference">ISO/IEC 14496-12:2022 — Information technology — Coding of audio-visual objects — Part 12: ISO base media file format <<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://www.iso.org/standard/83102.html" />></para>
<para role="reference">ISO/IEC 14496-14:2020 — Information technology — Coding of audio-visual objects — Part 14: MP4 file format <<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://www.iso.org/standard/79110.html" />></para>
<para role="reference">ISO/IEC 23000-19:2020 — Information technology — Multimedia application format (MPEG-A) — Part 19: Common media application format (CMAF) for segmented media <<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://www.iso.org/standard/79106.html" />></para>
<para role="reference">ISO/IEC 23001-7:2016 — Information technology — MPEG systems technologies — Part 7: Common encryption in ISO base media file format files <<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://www.iso.org/standard/68042.html" />></para>
<para role="reference">ISO 8601-1:2019 — Date and time — Representations for information interchange — Part 1: Basic rules <<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://www.iso.org/standard/70907.html" />></para>
<para role="reference">RFC 5234 — Augmented BNF for Syntax Specifications: ABNF <<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://www.ietf.org/rfc/rfc5234.txt" />></para>
<para role="reference">RFC 6381 — The 'Codecs' and 'Profiles' Parameters for "Bucket" Media Types <<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://www.ietf.org/rfc/rfc6381.txt" />></para>
<para role="reference">ONVIF Core Specification <<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.onvif.org/specs/core/ONVIF-Core-Specification.pdf"></link>></para>
<para role="reference">ONVIF Schedule Service Specification <<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://www.onvif.org/specs/srv/sched/ONVIF-Scheduler-Service-Spec.pdf"></link>> </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">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">Recording</emphasis>
</para>
</entry>
<entry align="left">
<para>A container for a set of audio, video and metadata tracks. A recording can hold one or more tracks. A track is viewed as an infinite timeline that holds data at certain times.</para>
</entry>
</row>
<row>
<entry align="left">
<para>
<emphasis role="bold">Recording Event</emphasis>
</para>
</entry>
<entry align="left">
<para>An event associated with a Recording, represented by a notification message in the APIs</para>
</entry>
</row>
<row>
<entry align="left">
<para>
<emphasis role="bold">Recording Job</emphasis>
</para>
</entry>
<entry align="left">
<para>A job performs the transfer of data from a data source to a particular recording using a particular configuration</para>
</entry>
</row>
<row>
<entry align="left">
<para>
<emphasis role="bold">Track</emphasis>
</para>
</entry>
<entry align="left">
<para>An individual data channel consisting of video, audio, or metadata. This definition is consistent with the definition of track in [RFC 2326]</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>
</chapter>
<chapter>
<title>Overview</title>
<section>
<title>Storage</title>
<para>This standard provides a set of interfaces that enable the support of interoperable network storage devices, such as network video recorders (NVR), digital video recorders (DVR) and cameras with embedded storage.</para>
<para>The following functions are supported:</para>
<itemizedlist>
<listitem>
<para>Recording Control</para>
</listitem>
<listitem>
<para>Search</para>
</listitem>
<listitem>
<para>Replay</para>
</listitem>
</itemizedlist>
<para>These functions are provided by three interrelated services:</para>
<para>
<emphasis role="bold">Recording service </emphasis>enables a client to manage recordings, and to configure the transfer of data from data sources to recordings. Managing recordings includes creation and deletion of recordings and tracks.</para>
<para>
<emphasis role="bold">Search service</emphasis> enables a client to find information about the recordings on the storage device, for example to construct a “timeline” view, and to find data of interest within a set of recordings. The latter is achieved by searching for events that are included in the metadata track recording,</para>
<para>
<emphasis role="bold">Replay service</emphasis> enables a client to play back recorded data, including video, audio and metadata. Functions are provided to start and stop playback and to change speed and direction of the replayed stream. It also enables a client to download data from the storage device so that export functionality can be provided.</para>
<para>WSDL for this service is specified in <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.onvif.org/onvif/ver10/recording.wsdl">http://www.onvif.org/onvif/ver10/recording.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>trc</para>
</entry>
<entry>
<para>http://www.onvif.org/ver10/recording/wsdl</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
<section>
<title>Storage Model</title>
<para>The storage interfaces in this standard present a logical view of the data on the storage device. This view is completely independent of the way data might be physically stored on disk.</para>
<para>The key concept in the storage model is that of a <emphasis>recording</emphasis>. The term <emphasis>recording</emphasis> is used in this specification to denote a container for a set of related audio, video and metadata <emphasis>tracks</emphasis>, typically from the same data source e.g. a camera. A <emphasis>recording</emphasis> could hold any number of tracks. A <emphasis>track</emphasis> is viewed as an infinite timeline that holds data at certain times. </para>
<para>At a minimum, a recording is capable of holding three tracks, one for audio, one for video and one for metadata. Some implementations of the recording service may support multiple tracks of each type. For example the same recording could hold two video tracks, one containing a low resolution or low frame rate stream and one containing a high resolution or high frame rate stream.</para>
<figure>
<title>Storage Model with Tracks</title>
<mediaobject>
<imageobject>
<imagedata fileref="media/RecordingControl/image2.svg" contentwidth="131.41mm" contentdepth="47.33mm" />
</imageobject>
</mediaobject>
</figure>
<para>It is important to note that the storage interfaces do not expose the internal storage structures on the device. In particular, a recording is not intended to represent a single file on disk although in many storage device implementations a recording is physically stored in a series of files. For instance, some camera implementations realise alarm recording by creating a distinct file for each alarm that occurs. Although each file could be represented as a different <emphasis>recording</emphasis>, the intent of the model in this standard is that all these files are aggregated into a single recording.</para>
<para>Within a recording the regions where data is actually recorded are represented by pairs of events, where each pair comprises an event when recording started and an event when recording stopped. A client can construct the logical view of the recordings by using the FindRecordings and FindEvents methods of the search service.</para>
<para>If metadata is recorded, the metadata track can hold all the events generated by the data source (see the chapter on event handling and the MetadataConfiguration object). In addition, a device also conceptually records ONVIF defined historical events (see Recording Event Descriptions in the search service), this includes information like start and end of a recorded data range. A device may also conceptually record vendor specific historical events. Events generated by the device are not inserted in existing metadata tracks of recordings. The FindEvents method in the search service can find all the recorded events.</para>
</section>
<section>
<title>Recording</title>
<para>The recording service enables a client to manage recordings, and to configure the transfer of data from data sources to recordings. Managing recordings includes creation and deletion of recordings and tracks.</para>
<para>Recording jobs transfer data from a recording source to a recording. A recording source can be a receiver object created with the receiver service, or it can be a media profile that encodes data on a local device. The media profile could be used as a source on a camera with embedded storage.</para>
<para>To save data to a recording, a client first creates a recording and ensures that the recording has the necessary tracks. Then the client creates a recording job that pulls data from one or more sources and stores the data to the tracks in the recording. </para>
<para>Clients may set up multiple recording jobs that all record into the same recording. If multiple recording jobs are active, the device uses a priority scheme to select between the tracks defined in the recording jobs. Clients may change the mode of recording jobs at any time, thereby providing means to implement features like alarm recording or manual recording.</para>
<para>If a device supports scheduled recording, clients may configure scheduled recording by adding a scheduler token to the recording job. A recording job with a scheduler token will only record when the associated schedule is active. If the associated schedule of a recording job is inactive a job with lower recording priority may record.</para>
<para>By default a recording job is continuously recording. Devices supporting the
EventFilter can be configured such that they only record events. To provide some context
time intervals before and after the event may be captured.</para>
<para>The recording job relies on the receiver service for receiving the data from other devices through receiver objects identified by ReceiverTokens</para>
</section>
<section>
<title>External targets</title>
<para>
The target interface allows configuration for devices that support recording to external storage targets.
For authentication configuration see the related storage configuration APIs of the core specification.
</para>
<para>
The target API defines for each recording a path on the storage device where the related recordings should be stored.
In order to keep reasonably sized files the recordings are split into segments.
This specification defines a date and time based index.
Indexing according to events and video content is outside of the scope of this specification.
</para>
<para>An encryption configuration interface allows to encrypt the content according to well defined standards.</para>
</section>
</section>
</chapter>
<chapter>
<title>
<emphasis role="highlight" />Recording control</title>
<section>
<title>Introduction</title>
<para>The recording service enables a client to manage recordings, and to configure the transfer of data from data sources to recordings. Managing recordings includes creation and deletion of recordings and tracks, as well as locking and unlocking ranges of recordings and deletion of recorded data.</para>
<para>Recording jobs transfer data from a recording source to a recording. A recording source can be a receiver object created with the receiver service, or it can be a media profile that encodes data on a local device. The media profile could be used as a source on a camera with embedded storage.</para>
<para>The term <emphasis>recording</emphasis> is used in this specification to denote a container for a set of audio, video and metadata tracks. A recording could hold any number of tracks. A track is viewed as an infinite timeline that holds data at certain times.</para>
<figure>
<title>Example of recordings and tracks</title>
<mediaobject>
<imageobject>
<imagedata fileref="media/RecordingControl/image2.svg" contentwidth="131.41mm" contentdepth="47.33mm" />
</imageobject>
</mediaobject>
</figure>
<para>The figure shows three recordings, each with a video, a metadata and two audio tracks. Here second audio track is used for storing the audio backchannel.</para>
<para>At a minimum, a recording shall be capable of holding three tracks, one for audio, one for video and one for metadata. Some implementations of the recording service may support multiple tracks of each type. All recorded data of a track shall have the same encoding.</para>
<para>To save data to a recording, a client first creates a recording and ensures that the recording has the necessary tracks. Then the client creates a recording job that pulls data from one or more sources and stores the data to the tracks in the recording. </para>
<para>Clients may set up multiple recording jobs that all record into the same recording. If multiple recording jobs are active, the device uses a priority scheme to select between the tracks defined in the recording jobs. Clients may change the mode of recording jobs at any time, thereby providing means to implement features like alarm recording or manual recording. A recording job with schedule token shall only be recording when the associated schedule is active.</para>
<para>For the cases where media attributes of a source are changed for an active recording job, the recording state is outside the scope of this specification.</para>
<para>The recording job relies on the receiver service for receiving the data from other devices through receiver objects identified by ReceiverTokens</para>
<para>For the cases where a client uses a receiver object with a single recording job, the recording service can auto create and auto delete receiver objects. Autocreation is signalled with the AutoCreateReceiver flag in the recording job configuration structure. Receiver objects created this way shall be automatically deleted when no recording job uses them anymore. A receiver object that is automatically created shall have all its fields set to empty values. The client should configure the receiver object after it has created the recording job.</para>
<para>The ONVIF view of recordings is a logical one which is independent of the way recordings are physically stored on disk. For instance, some camera implementations realise alarm recording by creating a distinct file on a FAT file system for each alarm that occurs. Although each file could be represented as a different ONVIF recording, the intent of the model in this standard is that all these files are aggregated into a single recording. By searching for the “DataPresent” event with the FindEvents method of the search service, a client can locate the times at which video started to be recorded and where video stopped being recorded.</para>
<para>If Metadata is recorded, the metadata can also hold all the events generated by the data source (see section event handling of the ONVIF Core Specification and section on Metadata configuration in the ONVIF Media Service Specification). In addition, a device also conceptually record ONVIF defined historical events (see Recording Event Descriptions in the search service), this includes information like start and end of a recorded data range. A device may also conceptually record vendor specific historical events. Events generated by the device are not inserted in existing metadata tracks of recordings. The FindEvents method in the search service can find all the recorded events. Many device implementations will automatically delete the oldest recorded data from storage in order to free up space for new recordings. Locks provide a mechanism to allow a user to select ranges of data. A range of data that is locked does not get deleted automatically. Support for locks is reserved for future versions of the specification.</para>
</section>
<section>
<title>General Requirements</title>
<para>All the objects created within the recording service shall be persistent – i.e. they shall survive a power cycle. Likewise, all the configuration data in the objects shall be persistent.</para>
</section>
<section xml:id="_Toc247178839">
<title>Data structures</title>
<section>
<title>RecordingConfiguration</title>
<para>The RecordingConfiguration structure shall be used to configure recordings through CreateRecordings and Get/SetRecordingConfiguration.</para>
<para>
<emphasis role="bold">MaximumRetentionTime</emphasis> specifies the maximum time that data in any track within the recording shall be stored. The device shall delete any data older than the maximum retention time. Such data shall not be accessible anymore. If the MaximumRetentionPeriod is set to 0, the device shall not limit the retention time of stored data, except by resource constraints. Whatever the value of MaximumRetentionTime, the device may automatically delete recordings to free up storage space for new recordings.</para>
<para>
None of the other fields defined in this structure shall be used by the device.
Instead, it simply stores this information, and it shall return it through the <emphasis>GetRecordingConfiguration</emphasis> and <emphasis>GetRecordingInformation</emphasis> (see ONVIF Recording Search Service Specification) methods.</para>
<para>
A device may truncate any descriptive string without causing a fault if it exceeds the supported length.
Descriptive strings are Location, Description and Content.
</para>
<para>
A device signaling support for recording to external targets via the SupportedTargetFormats capability shall support the target configuration with the following parameters:
</para>
<variablelist>
<varlistentry>
<term>Storage</term>
<listitem>
<para>Token of a storage configuration.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Format</term>
<listitem>
<para>
Format of the recording.
Examples are <literal>MP4</literal> and <literal>CMAF</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Prefix</term>
<listitem>
<para>Path prefix to be inserted in the object key.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Postfix</term>
<listitem>
<para>Path postfix to be inserted in the object key.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>SpanDuration</term>
<listitem>
<para>Maximum duration of a span.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>SegmentDuration</term>
<listitem>
<para>Maximum duration of a segment.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Encryption</term>
<listitem>
<para>Optional encryption configuration.</para>
</listitem>
</varlistentry>
</variablelist>
<para> See <xref linkend="_refCloudRecording"/> for ONVIF defined recording formats.</para>
</section>
<section>
<title>TrackConfiguration</title>
<para>The TrackConfiguration structure shall be used to configure tracks using CreateTrack and Get/SetTrackConfiguration</para>
<para>The TrackConfiguration contains the following fields:</para>
<para>The <emphasis role="bold">TrackType</emphasis> defines the data type of the track. It shall be equal to the strings “Video”, “Audio” or “Metadata”. The track shall only be able to hold data of that type.</para>
<para>None of the other fields defined in this structure shall be used by the device. Instead, it simply stores this information, and it shall return it through the <emphasis>GetTrackConfiguration</emphasis> and <emphasis>GetRecordingInformation</emphasis> (see ONVIF Recording Search Service Specification) methods.</para>
</section>
<section>
<title>RecordingJobConfiguration</title>
<para>The RecordingJobConfiguration structure shall hold the configuration for a recording job. Its UML diagram is hown in <xref linkend="image3"/>.</para>
<figure xml:id="image3">
<title>UML diagram of the RecordingJobConfiguration</title>
<mediaobject>
<imageobject>
<imagedata fileref="media/RecordingControl/image3.svg" contentdepth="75.89mm" />
</imageobject>
</mediaobject>
</figure>
<para>The RecordingJobConfiguration holds the following fields:</para>
<para>
<emphasis role="bold">RecordingToken</emphasis>: Identifies the recording to which this job shall store the received data.</para>
<para>
<emphasis role="bold">Mode</emphasis>: If it is idle, nothing shall happen. If it is active and the recording job has the highest priority, the device shall try to obtain data from the receivers. A client shall use GetRecordingJobState to determine if data transfer is really taking place. The only valid values for Mode shall be “Idle” and “Active”.</para>
<para>
<emphasis role="bold">Priority</emphasis>: This shall be a non-negative number. If there
are multiple recording jobs that store data to the same track, the device shall only store
data for the recording job with the highest priority. The priority is specified per
recording job, but the device shall determine the priority of each track individually. If
there are multiple recording jobs with the same highest priority it is undefind which of
them is activated.</para>
<para>The value 0 indicates the lowest priority. Higher values shall indicate a higher priority.</para>
<para>
<emphasis role="bold">ScheduleToken:</emphasis> This attribute adds an additional requirement for activating the recording job. If this optional field is provided the job shall only record if the schedule exists and is active.</para>
<para>
<emphasis role="bold">EventFilter:</emphasis> This set of parameters allows to control recording depending on a given set of event condititions.</para>
<para>
<emphasis role="bold">SourceToken</emphasis>: This field shall be a reference to the source of the data. The type of the source is determined by the attribute Type in the SourceToken structure. If Type is http://www.onvif.org/ver10/schema/Receiver, the token is a ReceiverReference. In this case the device shall receive the data over the network. If Type is http://www.onvif.org/ver10/schema/Profile, the token identifies a media profile, instructing the device to obtain data from a profile that exists on the local device. </para>
<para>A device that includes the ONVIF Media Service shall support a Media Profile token and a device that includes the ONVIF Receiver Service shall support a Receiver token.</para>
<para>
<emphasis role="bold">AutoCreateReceiver</emphasis>: If a request includes this field set to true and no source token is provided, the device shall create a
receiver object (through the receiver service) and assign the ReceiverReference to the
<emphasis role="bold">SourceToken</emphasis> field. A device shall never report this parameter in a
RecordingJobConfiguration. A device may reject a request that neither contains a SourceToken nor AutoCreateRecevier set to true.</para>
<para>
<emphasis role="bold">SourceTag</emphasis>: If the received RTSP stream contains multiple tracks of the same type, the <emphasis role="bold">SourceTag</emphasis> differentiates between those Tracks.</para>
<para>
<emphasis role="bold">Destination</emphasis>: The destination is the track token of the track to which the device shall store the received data. All tracks must belong to the recording identified by the RecordingToken.</para>
<para>The TrackInformation field for a Track holds a single Source. In case multiple RecordingJobs with differing Source are recording to the same Track it is undefined which of them is reported in the corresponding TrackInformation of the the RecordingSearch API.</para>
</section>
<section>
<title>Event recording</title>
<para>A device signalling support for EventRecording via its capabilities shall support
controling recording job activity via the EventFilter with the following set of
parameters:
</para>
<variablelist>
<varlistentry>
<term>Filter</term>
<listitem>
<para>One or more filter pairs containing a mandatory topic filter as defined in section 9.6.3 of the ONVIF Core Specification. It may be associated with an optional message content filter as defined in section 9.4.4 of the ONVIF Core
Specification. </para>
</listitem>
</varlistentry>
<varlistentry>
<term>Before</term>
<listitem>
<para>Optional timespan to record before the actual event condition became active.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>After</term>
<listitem>
<para>Optional timespan to record after the actual event condition becomes
inactive.</para>
</listitem>
</varlistentry>
</variablelist>
<para>A device shall support filtering on topics and message source parameters. Filtering on message data values doesn't need to be supported since it may cause malfunctions.</para>
<para>A device shall support Before and After durations when their limit is signalled via
the respective capability. A device may adapt the Before and After duration values to internal
quantization. </para>
<para>A device shall at least record the event duration and the specified before and after
timesspans. Due to the nature of GOP structures it may record more.</para>
<para>Note that non-property events result in an infinite short timespan. In such cases at least one I-Frame shall be recorded, optionally
extended by before and after timespans. </para>
<para>A recording job of a device supporting both EventFilter and ScheduledRecording shall
become active if both conditions are met.</para>
</section>
</section>
<section>
<title>CreateRecording</title>
<para>CreateRecording shall create a new recording.</para>
<para>This method is optional. It shall be available if the Recording/DynamicRecordings capability is TRUE.</para>
<variablelist role="op">
<varlistentry>
<term>request</term>
<listitem>
<para role="param">RecordingConfiguration [tt:RecordingConfiguration]</para>
<para role="text">Contains the initial configuration for the recording.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>response</term>
<listitem>
<para role="param">RecordingToken [tt:RecordingReference]</para>
<para role="text">The reference to the created recording.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>faults</term>
<listitem>
<para role="param">env:Receiver - ter:Action - ter:MaxRecordings</para>
<para role="text">The device cannot create a new recording because it already has the maximum number of recordings that it supports.</para>
<para role="param">env:Sender - ter:InvalidArgVal - ter:BadConfiguration</para>
<para role="text">The RecordConfiguration is invalid.</para>
<para role="param">env:Receiver - ter:ActionNotSupported - ter:NotImplemented</para>
<para role="text">This optional method is not implemented.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>access class</term>
<listitem>
<para role="access">ACTUATE</para>
</listitem>
</varlistentry>
</variablelist>
<para>When successfully completed, the device shall have created one or more tracks with the following configurations:</para>
<table>
<title>Track configurations</title>
<tgroup cols="2">
<colspec colname="c1" colwidth="50*" />
<colspec colname="c2" colwidth="50*" />
<tbody valign="top">
<row>
<entry>
<para>
<emphasis role="bold">TrackToken</emphasis>
</para>
</entry>
<entry>
<para>
<emphasis role="bold">TrackType</emphasis>
</para>
</entry>
</row>
<row>
<entry>
<para>VIDEO001</para>
</entry>
<entry>
<para>Video</para>
</entry>
</row>
<row>
<entry>
<para>AUDIO001</para>
</entry>
<entry>
<para>Audio</para>
</entry>
</row>
<row>
<entry>
<para>META001</para>
</entry>
<entry>
<para>Metadata</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
<para>The RecordingConfiguration shall have the MaximumRetentionTime set to 0 (unlimited) and all TrackConfigurations shall have the Description set to the empty string.</para>
</section>
<section>
<title>DeleteRecording</title>
<para>DeleteRecording shall delete a recording object. Whenever a recording is deleted, the device shall delete all the tracks that are part of the recording, and it shall delete all the Recording Jobs that record into the recording. For each deleted recording job, the device shall also delete all the receiver objects associated with the recording job that are automatically created using the AutoCreateReceiver field of the recording job configuration structure and are not used in any other recording job.</para>
<para>This method is optional. It shall be available if the Recording/DynamicRecordings capability is TRUE.</para>
<para>This method has no effect on the data stored in external targets for e.g. Object Storage
S3. </para>
<variablelist role="op">
<varlistentry>
<term>request</term>
<listitem>
<para role="param">RecordingToken [tt:RecordingReference]</para>
<para role="text">Identifies the recording that shall be 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:Sender - ter:InvalidArgVal - ter:NoRecording</para>
<para role="text">The RecordingToken does not reference an existing recording</para>
<para role="param">env:Receiver - ter:ActionNotSupported - ter:NotImplemented</para>
<para role="text">The device cannot delete recordings.</para>
<para role="param">env:Receiver - ter:Action - ter:CannotDelete</para>
<para role="text">This specific recording cannot be deleted.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>access class</term>
<listitem>
<para role="access">ACTUATE</para>
</listitem>
</varlistentry>
</variablelist>
</section>
<section>
<title>GetRecordings</title>
<para>GetRecordings shall return a description of all the recordings in the device. This description shall include a list of all the tracks for each recording.</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">RecordingItem – optional, unbounded [tt:GetRecordingsResponseItem]</para>
<para role="text">Identifies a recording and its current configuration</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_MEDIA</para>
</listitem>
</varlistentry>
</variablelist>
</section>
<section>
<title>SetRecordingConfiguration</title>
<para>SetRecordingConfiguration shall change the configuration of a recording</para>
<variablelist role="op">
<varlistentry>
<term>request</term>
<listitem>
<para role="param">RecordingToken [RecordingToken ]</para>
<para role="text">Identifies the recording that shall be changed.</para>
<para role="param">RecordingConfiguration [RecordingConfiguration]</para>
<para role="text">The new configuration for the recording.</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: BadConfiguration</para>
<para role="text">The configuration is invalid.</para>
<para role="param">env:Sender - ter:InvalidArgVal - ter:NoRecording</para>
<para role="text">The RecordingToken does not reference an existing recording.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>access class</term>
<listitem>
<para role="access">ACTUATE</para>
</listitem>
</varlistentry>
</variablelist>
</section>
<section>
<title>GetRecordingConfiguration</title>
<para>GetRecordingConfiguration shall retrieve the recording configuration for a recording</para>
<variablelist role="op">
<varlistentry>
<term>request</term>
<listitem>
<para role="param">RecordingToken [tt:RecordingReference]</para>
<para role="text">Identifies the recording for which the configuration shall be retrieved.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>response</term>
<listitem>
<para role="param">RecordingConfiguration [tt:RecordingConfiguration]</para>
<para role="text">The current configuration for the requested recording.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>faults</term>
<listitem>
<para role="param">env:Sender - ter:InvalidArgVal - ter:NoRecording</para>
<para role="text">The RecordingToken does not reference an existing recording.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>access class</term>
<listitem>
<para role="access">READ_MEDIA</para>
</listitem>
</varlistentry>
</variablelist>
</section>
<section>
<title>CreateTrack</title>
<para>This method shall create a new track within a recording if the method GetRecordingOptions signals spare tracks for the recording. For a track to be created the SpareXXX (where XXX is the track type) needs to be set.</para>
<para>This method is optional. It shall be available if the Recording/DynamicTracks capability is TRUE.</para>
<variablelist role="op">
<varlistentry>
<term>request</term>
<listitem>
<para role="param">RecordingToken [tt:RecordingReference]</para>
<para role="text">Identifies the recording to which a track shall be added.</para>
<para role="param">TrackConfiguration [tt:TrackConfiguration]</para>
<para role="text">The configuration for the new track.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>response</term>
<listitem>
<para role="param">TrackToken [tt:TrackReference]</para>
<para role="text">Identifies the newly created track. A device shall ensure that the TrackToken is unique within the recoding to which the new track belongs.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>faults</term>
<listitem>
<para role="param">env:Sender - ter:InvalidArgVal - ter:NoRecording</para>
<para role="text">The RecordingToken does not reference an existing recording.</para>
<para role="param">env:Receiver - ter:Action - ter:MaxTracks</para>
<para role="text">The new track cannot be created because the maximum number of tracks that the device supports for this recording has been reached.</para>
<para role="param">env:Sender - ter:InvalidArgVal - ter:BadConfiguration</para>
<para role="text">The TrackConfiguration is invalid.</para>
<para role="param">env:Receiver - ter:ActionNotSupported - ter:NotImplemented</para>
<para role="text">This optional method is not implemented.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>access class</term>
<listitem>
<para role="access">ACTUATE</para>
</listitem>
</varlistentry>
</variablelist>
<para>A TrackToken in itself does not uniquely identify a specific track. Tracks within different recordings may have the same TrackToken.</para>
</section>
<section>
<title>DeleteTrack</title>
<para>DeleteTrack shall remove a track from a recording. All the data in the track shall be deleted.</para>
<para>This method is optional. It shall be available if the Recording/DynamicTracks capability is TRUE.</para>
<para>This method has no effect on the data stored in external targets for e.g. Object Storage
S3. </para>
<variablelist role="op">
<varlistentry>
<term>request</term>
<listitem>
<para role="param">RecordingToken [tt:RecordingReference ]</para>
<para role="text">Identifies the recording from which to delete the track.</para>
<para role="param">TrackToken [tt:TrackReference]</para>
<para role="text">Identifies the track to delete.</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:NoRecording</para>
<para role="text">The RecordingToken does not reference an existing recording.</para>
<para role="param">env:Sender - ter:InvalidArgVal - ter:NoTrack</para>
<para role="text">The TrackToken does not reference an existing track of the recording.</para>
<para role="param">env:Receiver - ter:Action - ter:CannotDelete</para>
<para role="text">This specific track cannot be deleted.</para>
<para role="param">env:Receiver - ter:ActionNotSupported - ter:NotImplemented</para>
<para role="text">This optional method is not implemented.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>access class</term>
<listitem>
<para role="access">ACTUATE</para>
</listitem>
</varlistentry>
</variablelist>
</section>
<section>
<title>GetTrackConfiguration</title>
<para>GetTrackConfiguration shall retrieve the configuration for a specific track.</para>
<variablelist role="op">
<varlistentry>
<term>request</term>
<listitem>
<para role="param">RecordingToken [tt:RecordingReference ]</para>
<para role="text">Identifies the recording.</para>
<para role="param">TrackToken [tt:TrackReference]</para>
<para role="text">Identifies the track within the recording from which to get the track configuration</para>
</listitem>
</varlistentry>
<varlistentry>
<term>response</term>
<listitem>
<para role="param">TrackConfiguration [tt:TrackConfiguration]</para>
<para role="text">The current configuration for the track.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>faults</term>
<listitem>
<para role="param">env:Sender - ter:InvalidArgVal - ter:NoRecording</para>
<para role="text">The RecordingToken does not reference an existing recording.</para>
<para role="param">env:Sender - ter:InvalidArgVal - ter:NoTrack</para>
<para role="text">The TrackToken does not reference an existing track of the recording.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>access class</term>
<listitem>
<para role="access">READ_MEDIA</para>
</listitem>
</varlistentry>
</variablelist>
</section>
<section>
<title>SetTrackConfiguration</title>
<para>SetTrackConfiguration shall change the configuration of a track. TrackType shall be ignored by the device as it can’t be changed. The TrackConfiguration is the new configuration for the track.</para>
<variablelist role="op">
<varlistentry>
<term>request</term>
<listitem>
<para role="param">RecordingToken [tt:RecordingReference ]</para>
<para role="text">Identifies the recording.</para>
<para role="param">TrackToken [tt:TrackReference]</para>
<para role="text">Identifies the recording within the recording from which to set the track configuration</para>
<para role="param">TrackConfiguration [tt:TrackConfiguration]</para>
<para role="text">The new configurartion for the track.</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:NoRecording</para>
<para role="text">The RecordingToken does not reference an existing recording.</para>
<para role="param">env:Sender - ter:InvalidArgVal - ter:NoTrack</para>
<para role="text">The TrackToken does not reference an existing track of the recording.</para>
<para role="param">env:Sender - ter:InvalidArgVal - ter:BadConfiguration</para>
<para role="text">The contents of the configuration object are invalid.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>access class</term>
<listitem>
<para role="access">ACTUATE</para>
</listitem>
</varlistentry>
</variablelist>
</section>
<section>
<title>CreateRecordingJob</title>
<para>CreateRecordingJob shall create a new recording job. A device shall support adding a RecordingJob to a recording for which it signals Spare jobs via GetRecordingOptions.</para>
<para>A device should reject a configuration that neither includes a source with a source token nor AutoCreateReceiver set to true.</para>
<para>If the configuration doesn not include any tracks a device should assign all tracks of the corresponding recording.</para>
<variablelist role="op">
<varlistentry>
<term>request</term>
<listitem>
<para role="param">JobConfiguration [tt:RecordingJobConfiguration]</para>
<para role="text">The configuration of the new recording job.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>response</term>
<listitem>
<para role="param">JobToken [tt:RecordingJobReference ]</para>
<para role="text">Identifies the created recording job.</para>
<para role="param">JobConfiguration [tt:RecordingJobConfiguration]</para>
<para role="text">The configuration as it used by the device. This may be different from the JobConfiguration passed to CreateRecordingJob.</para>
</listitem>
</varlistentry>
<varlistentry>