Skip to content
Open
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
4ea4f5c
Define new ListRecordingSegments API
jflevesque-genetec Apr 2, 2024
f77c1f7
Add export segment API
jflevesque-genetec Apr 23, 2024
93373a3
Update wsdl
jflevesque-genetec Apr 25, 2024
7cf26eb
Update doc and add storage strategy
jflevesque-genetec May 23, 2024
fe536ee
Add annex
jflevesque-genetec Jun 5, 2024
c1175a8
Change segments API to use RecordingToken instead of RecordingJobToken
jflevesque-genetec Jul 9, 2024
5855d97
Add video source token to the RecordingSourceInformation
jflevesque-genetec Jul 9, 2024
786e45f
Update search API to have paging for ListRecordedSegments
jflevesque-genetec Jul 9, 2024
e06ee90
Update ExportRecordedSegments API to have paging
jflevesque-genetec Jul 9, 2024
62ee7ba
Add optional override storage configuration for export segments
jflevesque-genetec Sep 11, 2024
a9c3b02
Remove dependency on Device Mgmt by using StorageToken
jflevesque-genetec Sep 11, 2024
a97698b
Apply F2F suggestions for export
jflevesque-genetec Sep 12, 2024
b5acbfb
Apply suggestion for Search API from F2F
jflevesque-genetec Sep 12, 2024
7f39c1c
Move ListRecordedSegments from RecordingSearch to RecordingControl
jflevesque-genetec Oct 3, 2024
8d6e74c
Changed should to shall in export annex
jflevesque-genetec Oct 7, 2024
14fd86d
Add missing param in the specification
jflevesque-genetec Oct 22, 2024
f4aa907
Rename OmitSeqNumber to ForceZeroCounter
jflevesque-genetec Oct 22, 2024
891e81d
Fix a typo
jflevesque-genetec Nov 12, 2024
ae2d752
Fix namespaces from move from search service
jflevesque-genetec Nov 14, 2024
e8e971b
Minor updates based on San Diego F2F and prototyping
jflevesque-genetec Nov 20, 2024
f8cbb24
Update doc/RecordingControl.xml
jflevesque-genetec Feb 5, 2025
3453071
Update doc/RecordingControl.xml
jflevesque-genetec Feb 5, 2025
c5c9483
Update doc/RecordingControl.xml
jflevesque-genetec Feb 5, 2025
0110c68
Merge with override. Move StorageStrategy before the ##any
melanconj Mar 4, 2025
a3576f8
Unify maximum number of results request parameter and make it everywh…
HansBusch Mar 24, 2025
217dbe3
Segment Playback XML syntax fixes (#540)
HansBusch Apr 2, 2025
4b0beb7
Fix StopExportRecordedSegments response. VisualStudio needs empty seq…
HansBusch Apr 3, 2025
fe0dc83
Combine encapsulate response parameters. (#550)
HansBusch Apr 3, 2025
7e2ee39
Use xs:string for passing tt:TrackType to workaround Visual Studio op…
HansBusch Apr 8, 2025
b8b9f28
Improve export specification requirements (#541)
HansBusch Apr 15, 2025
26b4785
Document storage strategy and add configuration faults in case of mis…
HansBusch May 8, 2025
8442815
Remove requirement for StoragePath.
HansBusch May 14, 2025
45f15f7
Add fault section for ListRecordedSegments
jflevesque-genetec May 28, 2025
1bea111
Add another fault code
jflevesque-genetec May 28, 2025
7c7328d
Fix typo
jflevesque-genetec May 29, 2025
17fe7ed
Include optional alias when exporting segments
jflevesque-genetec Jun 5, 2025
834126a
Remove GetExportRecordedSegmentsState
jflevesque-genetec Jun 5, 2025
a37357c
Reword when the event is being raised
jflevesque-genetec Jun 5, 2025
e78d3cb
Add any element
jflevesque-genetec Jun 5, 2025
af89896
Fix typo
jflevesque-genetec Jun 5, 2025
f7bd8cb
Change Alias to SimpleItem
jflevesque-genetec Jun 13, 2025
4d9b29a
Merge pull request #582 from onvif/video/segment-based-playback-remov…
jflevesque-genetec Jul 15, 2025
4e63de6
Merge pull request #581 from onvif/video/segment-based-playback-alias
jflevesque-genetec Jul 15, 2025
0ec54a6
Clarify wording for ExportRecordedSegments
jflevesque-genetec Aug 12, 2025
f92f02a
Finish clean up of wsdl for stuff related to GetExportRecordedSegment…
jflevesque-genetec Sep 24, 2025
97d6d82
Update revision history
jflevesque-genetec Oct 2, 2025
eff0940
Add Fault if StorageStrategy is not supported
jflevesque-genetec Oct 2, 2025
5cb71af
Clarified StorageStrategy usage
jflevesque-genetec Oct 2, 2025
e3a3e75
Add clarification for segment inclusion based on time range
jflevesque-genetec Oct 2, 2025
49f72ab
Clean up leftover mentions for stuff that were dropped
jflevesque-genetec Oct 2, 2025
3fe8f7d
Replace must by shall
jflevesque-genetec Oct 2, 2025
a61ce1a
Merge development into branch
jflevesque-genetec Oct 2, 2025
4fdd421
Fix document
melanconj Oct 21, 2025
242ad37
Merge branch 'development' into video/segment-based-playback
melanconj Mar 11, 2026
b9fda0c
Fix badly fixed merge conflict
melanconj Mar 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
226 changes: 226 additions & 0 deletions doc/RecordingControl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1673,6 +1673,130 @@ Change Request 2061, 2063, 2065, 2109</revremark>
</varlistentry>
</variablelist>
</section>
<section>
<title>ListRecordedSegments</title>
<para>Lists available recorded segments related to the specified RecordingToken.</para>
<para>
The device shall provide results in StartTime ascending order.
The device can decide to send less results if it needs to.
The device shall indicate if there are more segments available in the time range by having the HasMoreResults field set to True.
</para>
<para>
When the HasMoreResults field is set to True in the response, the client shall adapt its next query by changing the From field
to the last EndTime received from the previous request. The client should continue until the HasMoreResults field is set to False.
</para>
<para>The listed segments shall have a stable start and end time as defined in Annex Stable Recordings.</para>
<variablelist role="op">
<varlistentry>
<term>request</term>
<listitem>
<para role="param">Time [tt:DateTimeRange]</para>
<para role="param">RecordingToken [tt:RecordingReference]</para>
<para role="param">MaxResults - optional [xs:int]</para>
<para role="text">The maximum number of results to return in one response.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>response</term>
<listitem>
<para role="param">Segment</para>
<para role="text">Contains a collection of segments with some basic metadata associated with the recording.</para>
<para role="param">HasMoreResults [xs:boolean]</para>
<para role="text">A flag indicating that more segments are available in the specified time range.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>access class</term>
<listitem>
<para role="access">READ_MEDIA</para>
</listitem>
</varlistentry>
</variablelist>
</section>
<section>
<title>ExportRecordedSegments</title>
<para>Exports the selected recorded segments (from existing recorded data) to the storage attached to the given recording job.</para>
<para>The StoragePath shall be the path as defined in the Object Storage annex appended to the StorageUri from the StorageConfiguration.</para>
<variablelist role="op">
<varlistentry>
<term>request</term>
<listitem>
<para role="param">Time [tt:DateTimeRange]</para>
<para role="param">RecordingToken [tt:RecordingReference]</para>
<para role="param">StorageToken - optional [tt:ReferenceToken]</para>
<para role="text">If provided, overrides the Target's storage configuration.</para>
<para role="param">Track - optional [tt:TrackType]</para>
<para role="text">An optional field if specified indicates which track is to be exported.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>response</term>
<listitem>
<para role="param">OperationToken [tt:ReferenceToken]</para>
</listitem>
</varlistentry>
<varlistentry>
<term>access class</term>
<listitem>
<para role="access">READ_MEDIA</para>
</listitem>
</varlistentry>
</variablelist>
</section>
<section>
<title>GetExportRecordedSegmentState</title>
<para>Retrieves the status of selected ExportRecordedSegments operation.</para>
<variablelist role="op">
<varlistentry>
<term>request</term>
<listitem>
<para role="param">OperationToken [tt:ReferenceToken]</para>
<para role="param">StartTime [xs:dateTime]</para>
<para role="text">The start index for the segment results.</para>
<para role="param">MaxResults - optional [xs:int]</para>
<para role="text">The maximum number of segment results to be provided in the response.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>response</term>
<listitem>
<para role="param">Segment [tt:UploadSegmentResult]</para>
<para role="param">HasMoreSegments [xs:boolean]</para>
<para role="text">A value indicating that the export has reached the maximum count and a new request must be sent to query the export state of further segments.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>access class</term>
<listitem>
<para role="access">READ_MEDIA</para>
</listitem>
</varlistentry>
</variablelist>
</section>
<section>
<title>StopExportRecordedSegments</title>
<para>Stops the selected ExportRecordedSegments operation.</para>
<variablelist role="op">
<varlistentry>
<term>request</term>
<listitem>
<para role="param">OperationToken [tt:ReferenceToken]</para>
</listitem>
</varlistentry>
<varlistentry>
<term>response</term>
<listitem>
<para role="text">This is an empty message.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>access class</term>
<listitem>
<para role="access">READ_MEDIA</para>
</listitem>
</varlistentry>
</variablelist>
</section>
<section>
<title>Events</title>
<para>Some of these events are similar to the automatically generated events that can be searched for by the FindEvents method in the search service. See ONVIF Recording Search Service Specification.</para>
Expand Down Expand Up @@ -2364,6 +2488,108 @@ secfrac = "." 1*6DIGIT</programlisting>
<programlisting>site-2/2022-11-08/camera-5/16/34-11.871Z.1020.m4m_end</programlisting>
</section>
</appendix>
<appendix xml:id="_refSegmentExport">
<title>Segment export (Normative)</title>
<section xml:id="_refSegmentExportOverview">
<title>Overview</title>
<para>
This annex describes the requirements for recording and exporting media streams in a cloud-friendly format.
Device will need to record on their local storage when a <literal>RecordingTargetConfiguration</literal> has its strategy set to "Local" or "Both".
While the device can record locally using any format, segments can be queried at any time and the resulting list of segments MUST be stable.
"Stable" here is defined in the sense that each frame will always be part of the same segment and the available segments are immutable.
</para>
<para>
Specific recorded segments can then be exported to the cloud on request and each exported segment MUST yield the same result (a CMAF or MP4 file
containing all its frames) on a successful export operation.
</para>
<para>
The deterministic properties of the segments (when queried or exported) facilitate features like HLS or MPEG-DASH playback from the device,
and also a simple way to implement on-demand video trickling from the local storage for a device to the cloud.
</para>
</section>
<section xml:id="_refSegmentExportRecording">
<title>Recording segments</title>
<para>
There are three possible recording strategies as defined for <literal>RecordingTargetConfiguration</literal>:
<variablelist>
<varlistentry>
<term>Cloud (default)</term>
<listitem>
<para>
The device will automatically upload each recorded segment to the Cloud location as soon as possible. After completion or on error the data won't be kept locally on the device.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Local</term>
<listitem>
<para>
The device will record the segments on its local storage and respect the MaximumRetentionTime of the RecordingConfiguration.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Both</term>
<listitem>
<para>
The device will record the segments on its local storage and respect the MaximumRetentionTime of the RecordingConfiguration. It will also attempt to automatically upload each segment to the Cloud location as they become available.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
When recording on its local storage, the device may need to delete the oldest recording segments if storage space is insufficient.
</para>
<para>
When uploading to the configured Cloud location, if an error occurs the device can retry but should abandon if the operation took too long and the next segment is ready to be uploaded.
Only whole segments should be uploaded and committed to the cloud storage (no incomplete segment should be made available on failure).
</para>
</section>
<section xml:id="_refSegmentExportCommands">
<title>Segment export commands</title>
<para>
The <literal>ListRecordedSegments</literal> command lists the segments currently available for export from the device local storage.
For a given time range, this command shall always return the same segments with two exceptions: the newly recorded segments are added as they become
available, and the deleted segments are removed from it (for example if the device had to delete them to make room for the new ones).
</para>
<para>
The <literal>ExportRecordedSegments</literal> command starts an export operation for all segment (partially or entirely) contained in the
specified time range. Multiple operations at the same time can be queued and processed sequentially. While the operation is being executed
the segments must not be deleted until they are uploaded (but the following ones can be). Segments should be uploaded in chronological order.
Progression can be tracked with <literal>GetExportRecordedSegmentState</literal>. Operations can be cancelled at any time with <literal>StopExportRecordedSegments</literal>.
The segment names used shall follow <xref linkend="_refCloudRecordingSegmentObjects"/>, with <literal>counter</literal> starting
at zero for the first segment of each export operation, unless the OmitSequenceNumber is set to True.
</para>
<para>
Note: it is possible that the segments listed with <literal>ListRecordedSegments</literal> are not exactly the ones exported with <literal>ExportRecordedSegments</literal>
as some segments could be deleted/added in-between the two commands being executed.
</para>
</section>
<section xml:id="_refSegmentExportStability">
<title>Segment stability</title>
<para>
Segment stability is essential for this feature: each frame must be part of exactly one segment and each segment must always be immutable in time.
Additionnally, each segment must start with a keyframe to make it independent from the previous one. Some devices may record frames in a proprietary
format, so the segments won't exist until exported to the cloud storage. Since the device must be able to list them beforehand, we suggest a simple
algorithm to determine how many segments will be in each time range and which frames will be part of them.
</para>
<para>
The figure <xref linkend="_refSegmentExportStabilityExample" /> illustrates how a global real time clock timestamp (that doesn't reset on device reboot
or resync on NTP) could be segmented in time ranges for the target segment duration with a modulus operation. Then each boundary of these ranges are
adjusted to match the time of the next keyframe. The result is the list of segment boundaries that overlap with the original time range of the query.
Care should be taken not to return the most recent segment if it is incomplete (when more frames may be appended to it later, i.e.: it overlaps with the current time).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jflevesque-genetec ,
Would be nice to clarify, the first segment case also. Even for the first segment, is it expected to find the next following Key Frame ? In this case there is a chance that some short initial duration might be missing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added The results shall include segments that cover the requested time range entirely, even if they start before or end after the requested time range.

</para>
<figure xml:id="_refSegmentExportStabilityExample">
<title>Example of possible algorithm to ensure segment stability</title>
<mediaobject>
<imageobject>
<imagedata fileref="media/RecordingControl/segmentExportStabilityExample 1.svg" contentwidth="120mm" />
</imageobject>
</mediaobject>
</figure>
</section>
</appendix>
<appendix role="revhistory">
<title>Revision History</title>
<para/>
Expand Down
2 changes: 1 addition & 1 deletion doc/RecordingSearch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1476,7 +1476,7 @@ http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace
<appendix>
<title>Deprecated Interfaces</title>
<section>
<title>A.1 Method for returning search status</title>
<title>Method for returning search status</title>
<para>The definition and interface for the returning search status have been deprecated with release 16.06. The following interfaces have been removed from the specification:</para>
<itemizedlist>
<listitem>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading