Skip to main content
Version: ACAP version 12

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.

  1. The application can monitor new recording segments with the Recording Notify API. See Recording Notify API - Use Cases.
  2. 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.
  3. The application can then retrieve the container IDs for a recording span with the Recording Search API. See Recording Search API - Use Cases.
  4. 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'
  5. 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.SegmentNotFound is returned.
  6. 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

  1. 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.
  2. 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'
  3. 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.General
  • com.axis.RecordingPlayback1.Error.InvalidArgument
  • com.axis.RecordingPlayback1.Error.SegmentNotFound
  • com.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.General
  • com.axis.RecordingPlayback1.Error.InvalidArgument
  • com.axis.RecordingPlayback1.Error.SegmentNotFound
  • com.axis.RecordingPlayback1.Error.Unauthorized