Recording Playback API
The Recording Playback application API makes it possible to get handles to recording segments.
Overview
Identification
gdbus introspect --system
--dest=com.axis.RecordingPlayback1
--object-path /com/axis/RecordingPlayback1
Check that the root node of the returned introspection data contains the
interface com.axis.RecordingPlayback1.Playback1.
The D-Bus error org.freedesktop.DBus.Error.ServiceUnknown will be
returned if the service is not available.
D-Bus Names
D-Bus Services: com.axis.RecordingPlayback1
Main D-Bus objects: /com/axis/RecordingPlayback1
D-Bus interfaces: com.axis.RecordingPlayback1.Playback1
Use Cases
Get all recording segments
A client wants to process all new recording segments since a saved timestamp of an ongoing recording.
Use Notify, Search and Playback interface for getting all segments of a recording group
All code listings are examples. See references for detailed description of each API command.
- The application can monitor new recording segments with the Recording Notify API. See Recording Notify API - Use Cases.
- The application can then list the recording spans newer than the saved timestamp for the recording group with the Recording Search API. See Recording Search API - Use Cases.
- The application can then retrieve the container IDs for a recording span with the Recording Search API. See Recording Search API - Use Cases.
- The application then retrieves a recording segment newer than the
saved timestamp for the video with:
gdbus call --system--dest=com.axis.RecordingPlayback1--object-path /com/axis/RecordingPlayback1--method com.axis.RecordingPlayback1.Playback1.GetSegment'SD_DISK' 'recgroup1:20231018062954053' 'v1''2023-10-18T06:29:54.053Z'
- The application then continues to retrieve recording segments for
the recording span by advancing the timestamp to the last seen stop
time until
com.axis.RecordingPlayback1.Error.SegmentNotFoundis returned. - The application then continues with the next recording span.
Get some recording segments
A client wants to retrieve a sequence of recording segments for playback of a recording.
Use Search and Playback interface for getting some segments of a recording group
- The application can list recording segments for a recording group and a time interval with the Recording Search API. See Recording Search API - Use Cases.
- The application then retrieves the recording segment with the first
segment ID in the returned list with:
gdbus call --system--dest=com.axis.RecordingPlayback1--object-path /com/axis/RecordingPlayback1--method com.axis.RecordingPlayback1.Playback1.GetSegmentById'SD_DISK:2023-10-18/recgroup120231018062954053/06/29-54.053Z.0.m4v'
- The application then continues to retrieve recording segments with the next segment ID in the returned list.
API Definition
com.axis.RecordingPlayback1.Playback1
This interface provides methods for retrieving recording segments.
The GetSegment method
GetSegment (in s storage_id,
in s span_id,
in s container_id,
in s search_time,
out h fd,
out s start_time,
out s stop_time,
out t size);
Returns a read-only file descriptor to the recording segment and some information about the segment. The offset of the file descriptor is set to the start of the segment data and may be proceeded by a header depending on the file system type.
Input parameters:
storage_id: The storage the recording span is stored on.span_id: The ID of the recording span that the segment belongs to.container_id: The ID of the container.search_time: Match segment at or after this time if set else first segment is returned.
Output parameters:
fd: A read-only file descriptor to the segment.start_time: The start time of the segment.stop_time: The stop time of the segment.size: The size of the segment in bytes.
Possible D-Bus errors:
com.axis.RecordingPlayback1.Error.Generalcom.axis.RecordingPlayback1.Error.InvalidArgumentcom.axis.RecordingPlayback1.Error.SegmentNotFoundcom.axis.RecordingPlayback1.Error.Unauthorized
The GetSegmentById method
GetSegmentById (in s segment_id,
out h fd);
Returns a read-only file descriptor to the recording segment. The offset of the file descriptor is set to the start of the segment data and may be proceeded by a header depending on the file system type.
Input parameters:
segment_id: The ID of the recording segment.
Output parameters:
fd: A read-only file descriptor to the segment.
Possible D-Bus errors:
com.axis.RecordingPlayback1.Error.Generalcom.axis.RecordingPlayback1.Error.InvalidArgumentcom.axis.RecordingPlayback1.Error.SegmentNotFoundcom.axis.RecordingPlayback1.Error.Unauthorized