diff --git a/doc/Core.xml b/doc/Core.xml
index 6f8345392..2b4a5ee8b 100644
--- a/doc/Core.xml
+++ b/doc/Core.xml
@@ -6627,14 +6627,15 @@ onvif://www.onvif.org/name/ARV-453
-
-
-
+
+
+
-
-
-
+
+
+
+
]]>
diff --git a/doc/RecordingControl.xml b/doc/RecordingControl.xml
index b8bfde158..e3e10304a 100644
--- a/doc/RecordingControl.xml
+++ b/doc/RecordingControl.xml
@@ -187,6 +187,15 @@ Change Request 2061, 2063, 2065, 2109
Add the possibility to temporary override of segment duration for Cloud Recording.
+
+ 25.12
+ Dec-2025
+
+ Jean-Francois Levesque
+ Jose Melancon
+
+ Add support for listing and export of segments to an Object Storage.
+
@@ -506,8 +515,15 @@ Change Request 2061, 2063, 2065, 2109
Optional encryption configuration.
+
+ StorageStrategy
+
+ Strategy whether to directly record to external storage or to local storage or both in parallel.
+
+ See for ONVIF defined recording formats.
+ A device signaling support for SegmentExport shall support StorageStrategy modes Local and Both.TrackConfiguration
@@ -555,7 +571,7 @@ Change Request 2061, 2063, 2065, 2109
SourceTag: If the received RTSP stream contains multiple tracks of the same type, the SourceTag differentiates between those Tracks.
- Destination: 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.
+ Destination: The destination is the track token of the track to which the device shall store the received data. All tracks shall belong to the recording identified by the RecordingToken.
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.
@@ -627,6 +643,8 @@ Change Request 2061, 2063, 2065, 2109
The RecordConfiguration is invalid.env:Receiver - ter:ActionNotSupported - ter:NotImplementedThis optional method is not implemented.
+ env:Receiver - ter:Action - ter:NoLocalRecording
+ Local recording not possible due to e.g. missing medium.
@@ -783,8 +801,8 @@ Change Request 2061, 2063, 2065, 2109
The configuration is invalid.env:Sender - ter:InvalidArgVal - ter:NoRecordingThe RecordingToken does not reference an existing recording.
- env:Sender - ter:InvalidArgVal - ter:AmbiguousConfiguration
- Key/KID and AsymmetricEncryption are mutually exclusive configuration parameters
+ Local recording not possible due to e.g. missing medium.
+ Storage strategy not supported.
@@ -1687,6 +1705,153 @@ Change Request 2061, 2063, 2065, 2109
Indicates that the device supports the OverrideSegmentDuration command.
+
+ SegmentExport
+
+ Indicates support for exporting recorded segments.
+
+
+
+
+
+ ListRecordedSegments
+ Lists available recorded segments related to the specified RecordingToken. A device
+ signaling support for SegmentExport shall support this function.
+
+ 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.
+
+
+ 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.
+
+ The listed segments shall have a stable start and end time as defined in Annex Stable Recordings.
+
+
+ request
+
+ Time [tt:DateTimeRange]
+ RecordingToken [tt:RecordingReference]
+ MaxResults - optional [xs:int]
+ The maximum number of results to return in one response.
+
+
+
+ response
+
+ Segment optional, unbounded [trc:Segment]
+ Contains a collection of segments with some basic metadata associated with the recording.
+ HasMoreResults [xs:boolean]
+ A flag indicating that more segments are available in the specified time range.
+
+
+
+ faults
+
+ env:Sender - ter:InvalidArgVal - ter:NoRecording
+ The RecordingToken does not reference an existing recording.
+ env:Sender - ter:InvalidArgVal - ter:NoStorage
+ The TargetConfiguration does not reference an existing storage configuration.
+
+
+
+ access class
+
+ READ_MEDIA
+
+
+
+
+
+ ExportRecordedSegments
+ Request an export for the specified time range from existing locally recorded data. As
+ such an operation can take long time, this method immediately returns an operation token. The
+ device shall emit events as defined in section 8.9.7 Asynchronous Operation Status of the
+ ONVIF Core specification. The device shall include the Alias parameter in the event if
+ provided in the request.
+ The Initialized event shall be emitted when returning the operation token.
+ Progress updates shall be sent to inform clients about the progress of the
+ export. Finally a Deleted event shall be emitted to signal completion or aborting of the
+ operation when StopExportRecordedSegments has been executed.
+ A device signaling support for SegmentExport shall support this function.
+ An event shall be raised after each segment is uploaded to the Object Storage, which means the
+ ArrayOfFileProgress shall have only a single element each time. The FileProgress element shall
+ have the FileName element be the path as defined in the Object Storage annex appended to the
+ StorageUri from the StorageConfiguration.
+ By default the segments are exported to the storage that is configured for the recording.
+ When the parameter StorageToken is provided this target will be used.
+ Note that a client may subscribe to tns1:Monitoring/AsynchronousOperationStatus for
+ enumeration and monitoring of active and queued exports.
+
+
+ request
+
+ Time [tt:DateTimeRange]
+ RecordingToken [tt:RecordingReference]
+ Alias - optional [xs:string]
+ If provided, shall be included in the Monitoring/AsynchronousOperationStatus event.
+ StorageToken - optional [tt:ReferenceToken]
+ If provided, overrides the Target's storage configuration.
+ Track - optional [tt:TrackType]
+ An optional field if specified indicates which track is to be exported.
+
+
+
+ response
+
+ OperationToken [tt:ReferenceToken]
+
+
+
+ faults
+
+ env:Sender - ter:InvalidArgVal - ter:NoRecording
+ The referenced recording does not exist.
+ env:Sender - ter:InvalidArgVal - ter:InvalidStorage
+ The referenced storage configuration does not exist or cannot be used.
+ env:Sender - ter:InvalidArgVal - ter:BadDuration
+ The value of the time parameter is invalid.
+
+
+
+ access class
+
+ READ_MEDIA
+
+
+
+
+
+ StopExportRecordedSegments
+ Stops the selected ExportRecordedSegments operation. A device signaling support for
+ SegmentExport shall support this function.
+
+
+ request
+
+ OperationToken [tt:ReferenceToken]
+
+
+
+ response
+
+ This is an empty message.
+
+
+
+ faults
+
+ env:Sender - ter:InvalidArgVal - ter:NoOperation
+ The referenced operation does not exist.
+
+
+
+ access class
+
+ READ_MEDIA
+
+
@@ -2571,6 +2736,109 @@ aligned(8) class AsymmetricKeySystemHeaderBox extends FullBox('pssh', version=1,
site-2/2022-11-08/camera-5/16/34-11.871Z.1020.m4m_end
+
+ Segment export (Normative)
+
+ Overview
+
+ 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 StorageStrategy has been 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 shall 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.
+
+
+ Specific recorded segments can then be exported to the cloud on request and each exported segment shall yield the same result (a CMAF or MP4 file
+ containing all its frames) on a successful export operation.
+
+
+ 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.
+
+
+
+ Recording segments
+
+ There are three possible recording StorageStrategy defined for RecordingTargetConfiguration:
+
+
+ External
+
+
+ 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.
+ This is the default value if none has been set.
+
+
+
+
+ Local
+
+
+ The device will record the segments on its local storage and respect the MaximumRetentionTime of the RecordingConfiguration.
+
+
+
+
+ Both
+
+
+ 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.
+
+
+
+
+
+
+ When recording on its local storage, the device may need to delete the oldest recording segments if storage space is insufficient.
+
+
+ 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).
+
+
+
+ Segment export commands
+
+ The ListRecordedSegments 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).
+ The results shall include segments that cover the requested time range entirely, even if they start before or end after the requested time range.
+
+ The ExportRecordedSegments command requests an export operation for
+ a time-range of segments. A device shall accept multiple request but may queue and process
+ them sequentially. Segments shall be uploaded in chronological order. Progress can be
+ tracked via the AsynchronousOperationStatus event. Operations can be cancelled at any time
+ with StopExportRecordedSegments. The segment names shall follow .
+
+ Note: it is possible that the segments listed with ListRecordedSegments are not exactly the ones exported with ExportRecordedSegments
+ as some segments could be deleted/added in-between the two commands being executed.
+
+
+
+ Segment stability
+
+ Segment stability is essential for this feature: each frame shall be part of exactly one segment and each segment shall always be immutable in time.
+ Additionally, each segment shall 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 shall 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.
+
+
+ The figure 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).
+
+
+ Example of possible algorithm to ensure segment stability
+
+
+
+
+
+
+
+ Revision History
diff --git a/doc/RecordingSearch.xml b/doc/RecordingSearch.xml
index e6840df9a..1a3988c50 100644
--- a/doc/RecordingSearch.xml
+++ b/doc/RecordingSearch.xml
@@ -1476,7 +1476,7 @@ http://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace
Deprecated Interfaces
- A.1 Method for returning search status
+ Method for returning search statusThe definition and interface for the returning search status have been deprecated with release 16.06. The following interfaces have been removed from the specification:
diff --git a/doc/media/RecordingControl/segmentExportStabilityExample 1.svg b/doc/media/RecordingControl/segmentExportStabilityExample 1.svg
new file mode 100644
index 000000000..b079395e4
--- /dev/null
+++ b/doc/media/RecordingControl/segmentExportStabilityExample 1.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/wsdl/ver10/recording.wsdl b/wsdl/ver10/recording.wsdl
index 341396b81..3ae3731bc 100644
--- a/wsdl/ver10/recording.wsdl
+++ b/wsdl/ver10/recording.wsdl
@@ -146,6 +146,13 @@ IN NO EVENT WILL THE CORPORATION OR ITS MEMBERS OR THEIR AFFILIATES BE LIABLE FO
+
+
+
+ Indicates support for ExportRecordedSegments.
+
+
+
@@ -594,7 +601,6 @@ IN NO EVENT WILL THE CORPORATION OR ITS MEMBERS OR THEIR AFFILIATES BE LIABLE FO
-
@@ -623,7 +629,6 @@ IN NO EVENT WILL THE CORPORATION OR ITS MEMBERS OR THEIR AFFILIATES BE LIABLE FO
-
@@ -653,6 +658,134 @@ IN NO EVENT WILL THE CORPORATION OR ITS MEMBERS OR THEIR AFFILIATES BE LIABLE FO
+
+
+
+ Gets segments available within a time range.
+
+
+
+
+
+ The start to end time of the query.
+
+
+
+
+ The recording configuration token.
+
+
+
+
+ The maximum number of results to return in one response.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Information about an exportable segment.
+
+
+
+
+
+ Same precision as defined in the Recording Control specification for segment objects.
+
+
+
+
+ Same precision as defined in the Recording Control specification for segment objects.
+
+
+
+
+ As defined in RFC 6381 including section 3 Codecs.
+
+
+
+
+
+
+
+
+
+ A value indicating that the search has reached the maximum count and a new request must be sent to continue the search.
+
+
+
+
+
+
+
+
+
+ The start to end time of the query.
+
+
+
+
+ The recording configuration token.
+
+
+
+
+ An optional alias that shall be included in the Monitoring/AsynchronousOperationStatus events.
+
+
+
+
+ If provided, overrides the Target's storage configuration.
+
+
+
+
+ An optional track filter for segments to export when in CMAF. For valid definitions see tt:TrackType.
+
+
+
+
+
+
+
+
+
+
+
+ Unique operation token for client to query the status of the export.
+
+
+
+
+
+
+
+
+
+
+
+ Unique ExportRecordedSegments operation token
+
+
+
+
+
+
+
+
+
+
+
@@ -833,13 +966,30 @@ IN NO EVENT WILL THE CORPORATION OR ITS MEMBERS OR THEIR AFFILIATES BE LIABLE FO
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -994,6 +1144,26 @@ IN NO EVENT WILL THE CORPORATION OR ITS MEMBERS OR THEIR AFFILIATES BE LIABLE FO
+
+
+ Lists available recorded segments related to the specified RecordingToken.
+
+
+
+
+
+ Exports the selected recorded segments (from existing recorded data) to the storage attached to the given recording configuration.
+
+
+
+
+
+
+ Stops the selected ExportRecordedSegments operation.
+
+
+
+
Exports the selected recordings (from existing recorded data) to the given storage target based on the requested file format.
@@ -1225,6 +1395,33 @@ IN NO EVENT WILL THE CORPORATION OR ITS MEMBERS OR THEIR AFFILIATES BE LIABLE FO
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/wsdl/ver10/schema/onvif.xsd b/wsdl/ver10/schema/onvif.xsd
index 5012beb02..615ad6c87 100755
--- a/wsdl/ver10/schema/onvif.xsd
+++ b/wsdl/ver10/schema/onvif.xsd
@@ -7723,6 +7723,11 @@ and sample rate.
URI provided by the service supplying data to be recorded. A device shall support at least 128 characters.
+
+
+ The video source token of all recordings that will use this configuration.
+
+
@@ -7886,10 +7891,40 @@ and sample rate.
+
+
+ Strategy to be used on how to store recordings, see tt:StorageStrategy for allowed values. If undefined, defaults to External.
+
+
+
+
+
+
+ Indicates that device must record to the storage defined by the StorageConfiguration token.
+
+
+
+
+
+ Indicates that device must record on its local storage and can export recorded data to the external
+ storage using ExportRecordedSegments.
+
+
+
+
+
+
+ Indicates that device must record on both local storage and external storage and locally recorded data can
+ be exported if connectivity issue prevented export to external storage during normal operation.
+
+
+
+
+
@@ -8117,7 +8152,7 @@ and sample rate.
- Sspecifies the maximum time that data in any track within the
+ 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.
diff --git a/wsdl/ver10/search.wsdl b/wsdl/ver10/search.wsdl
index c995be557..93087b9d6 100644
--- a/wsdl/ver10/search.wsdl
+++ b/wsdl/ver10/search.wsdl
@@ -117,7 +117,7 @@ IN NO EVENT WILL THE CORPORATION OR ITS MEMBERS OR THEIR AFFILIATES BE LIABLE FO
- Gets results from a particular recording listingession.
+ Gets results from a particular recording listing session.
diff --git a/wsdl/ver20/media/wsdl/media.wsdl b/wsdl/ver20/media/wsdl/media.wsdl
index 7ac53db10..f7fabf512 100644
--- a/wsdl/ver20/media/wsdl/media.wsdl
+++ b/wsdl/ver20/media/wsdl/media.wsdl
@@ -797,7 +797,7 @@ IN NO EVENT WILL THE CORPORATION OR ITS MEMBERS OR THEIR AFFILIATES BE LIABLE FO
- Video Media Subtype for the video format. For definitions see tt:VideoEncodingMimeNames and IANA Media Types.
+ Video Media Subtype for the video format. For definitions see tt:VideoEncodingMimeNames and IANA Media Types.