Detailed Description

The Archive Service provides access to the edge archive on an Encoder.

If and Encoder has an edge archive configured the SDK can access the archive and retrieve the following information:

  • Playback footage from the Remote archive over the live TVI stream:
    • Get a list of days, hours and minutes for which recorded footage exists.
    • Get a list of bookmarks that are available in the archive.
    • Start and stop playback of the remote archive
    • Change the playback speed (fast forward, rewind, pause, normal speed).
  • Download the Archive content at its original recorded quality
    • The Archive Exporter Service can download the original file as stored on the device. This file may be password protected and have fragile watermarking.
    • The GoP (Group of Pictures) downloader will download the archive video content as a standards based file chunks.

The Archive Service can only be used by one client application at a time. While the Archive Service is held open by one user other users (applications) will not be able to open it. When designing applications please keep this in mind. For example, it may be beneficial to add a feature that will automatically close the Archive Service if the user has not used it for a while. It is also worth noting that the Archive Exporter Service cannot be used at the same time as recorded footage is being played back live.

File Download

There are two mechanisms to download the original archive file from the edge archive.

Original File

Using the Archive Exporter Service the original file as stored on the device can be downloaded.

For Encoder with built in Archives these files are stored in our CSX archive format. CSX files include the video and audio recorded in high quality and in a standards based format. CSX files also have fragile watermarking to protect files from tampering and can also be encrypted with a user defined password. The files also store associated metadata relevant to the recorded footage.

CSX files can only be downloaded in their entirety. To view CSX files use the "Export Player" application.

GoP Transfer

Alternatively the GoP download service can be used to retrieve just the standards based footage stored on the device.

The encoder will extract the standards based content from the CSX file. Any encryption, watermarking and metadata is not retrievable.

The GoP transfer can transfer only the times requested extracted from the CSX file

Availability

Available in version 6.0 of Decoder SDK. Requires a server version greater than 6.0 GoP Transfer service available in version 6.1 of Decoder SDK. Requires a server version greater than 6.1

#include <ArchiveService.h>

Public Member Functions

DB_EDGEVIS_SDK bool PlaybackAllowed () const
Determines if recorded footage can be played back or not. More...
 
DB_EDGEVIS_SDK bool Recording () const
Determines whether the archive is currently recording or not. More...
 
DB_EDGEVIS_SDK OpResult SetRecording (bool rec)
Turns edge archive recording on or off. More...
 
DB_EDGEVIS_SDK std::wstring ArchiveType () const
Gets the type of archive connected to the Encoder. More...
 
DB_EDGEVIS_SDK bool ExternalArchiveEnabled () const
Determines if the encoder is using an external archive device. More...
 
DB_EDGEVIS_SDK bool Exists () const
Determines if an archive device is connected to the Encoder and configured. More...
 
DB_EDGEVIS_SDK int32_t MaxQueryDays () const
Gets the maximum number of days that can be added to a filter when querying for hours from the archive. More...
 
DB_EDGEVIS_SDK int32_t MaxQueryHours () const
Gets the maximum number of hours that can be added to a filter when querying for minutes from the archive. More...
 
DB_EDGEVIS_SDK int32_t MaxQuerySpanHours () const
Returns the maximum span in hours that can be queried by QueryHours(start, end). More...
 
DB_EDGEVIS_SDK int32_t MaxQuerySpanMinutes () const
Returns the maximum span in minutes that can be queried by QueryMinutes(start, end). More...
 
DB_EDGEVIS_SDK size_t QueryHours (const int64_t startTime, const int64_t endTime, Timeline *timeline)
Queries the archive for a list of hour timestamps for which there is footage available. More...
 
DB_EDGEVIS_SDK size_t QueryMinutes (const int64_t startTime, const int64_t endTime, Timeline *timeline)
Queries the archive for a list of minutes timestamps for which there is footage available. More...
 
DB_EDGEVIS_SDK size_t QueryDays (Timeline *timeline)
Queries the archive for a list of day timestamps for which there is footage available. More...
 
DB_EDGEVIS_SDK size_t QueryHours (const int64_t dayTs, Timeline *timeline)
Queries the archive for a list of hour timestamps for which there is footage available. More...
 
DB_EDGEVIS_SDK size_t QueryHours (const Timeline::TimesList &days, Timeline *timeline, size_t count=0, size_t offset=0)
Queries the archive for a list of hour timestamps for which there is footage available. More...
 
DB_EDGEVIS_SDK size_t QueryMins (const int64_t hourTs, Timeline *timeline)
Queries the archive for a list of minute timestamps for which there is footage available. More...
 
DB_EDGEVIS_SDK size_t QueryMins (const Timeline::TimesList &hours, Timeline *timeline, size_t count=0, size_t offset=0)
Queries the archive for a list of minute timestamps for which there is footage available. More...
 
DB_EDGEVIS_SDK OpResult QueryRecordings (const int64_t startTime, const int64_t endTime, const int32_t input, ArchiveRecordingInfo &result)
Queries the archive for information on the available recordings. More...
 
DB_EDGEVIS_SDK OpResult QueryRecordings (const int64_t startTime, const int64_t endTime, const int32_t input, const ArchiveFileSource source, ArchiveRecordingInfo &result)
Queries the archive for information on the available recordings. More...
 
DB_EDGEVIS_SDK OpResult QueryBookmarks (std::vector< ArchiveBookmark > &bookmarks)
Queries the archive for a list of bookmarks. More...
 
DB_EDGEVIS_SDK OpResult AddBookmark (const int64_t timestamp, const int32_t input, const std::wstring &name, const std::wstring &description, ArchiveBookmark &result)
Adds a new bookmark to the list of bookmarks on the Encoder. More...
 
DB_EDGEVIS_SDK OpResult DeleteBookmark (const ArchiveBookmark &bookmark)
Deletes a bookmark from the list of bookmarks on the Encoder. More...
 
DB_EDGEVIS_SDK OpResult StartPlayback (const int64_t ts)
Starts media playback from the specified timestamp. More...
 
DB_EDGEVIS_SDK OpResult StopPlayback ()
Stops archive video playback. More...
 
DB_EDGEVIS_SDK OpResult SetPlaybackSpeed (ArchivePlaybackSpeed speed)
Sets the archive playback speed to the specified speed. More...
 
DB_EDGEVIS_SDK ArchivePlaybackSpeed GetPlaybackSpeed ()
Get the speed of the archive playback. More...
 
DB_EDGEVIS_SDK ArchiveExporterService GetExporterService ()
Gets the ArchiveExporterService. More...
 
DB_EDGEVIS_SDK GOPDownloadService GetGOPDownloadService ()
Gets the GOPDownloadService. More...
 
DB_EDGEVIS_SDK bool IsArchiveInUTC () const
Determines if the archive is recording in UTC or local time. More...
 
DB_EDGEVIS_SDK bool IsArchiveOwner () const
Determines if the caller is the archive control owner. More...
 
- Public Member Functions inherited from EdgeVisDecoderSDK::Service
DB_EDGEVIS_SDK std::wstring ServiceName () const
Gets the name of the Service. More...
 
void UpdateState (ServiceState state, std::wstring user)
Updates the service's state. More...
 
DB_EDGEVIS_SDK bool Started () const
Determines whether the service has been started or not. More...
 
DB_EDGEVIS_SDK int32_t KeepAliveInterval () const
Retrieves the keep alive interval for the service. More...
 
DB_EDGEVIS_SDK int32_t IdleTimeoutInterval () const
Retrieves the idle timeout interval for the service. More...
 
DB_EDGEVIS_SDK void SetIdleTimeoutInterval (int32_t idleTimeout)
Sets the idle timeout interval for the service. More...
 
DB_EDGEVIS_SDK bool KeepAliveTaskRunning () const
Determines if the Keep alive task is currently running. More...
 
DB_EDGEVIS_SDK bool IdleTimeoutRunning () const
Determines if the idle timeout is currently running. More...
 
DB_EDGEVIS_SDK void RegisterListener (IServiceListener *listener)
Registers the specified listener to be notified when the service state changes. More...
 
DB_EDGEVIS_SDK void UnregisterListener (IServiceListener *listener)
Removes the specified listener from the set of listeners to be notified about service state changes. More...
 
DB_EDGEVIS_SDK int64_t GetServiceUptime () const
Retrieve the number of milliseconds since the service was started. More...
 

Member Function Documentation

DB_EDGEVIS_SDK bool EdgeVisDecoderSDK::ArchiveService::PlaybackAllowed ( ) const

Determines if recorded footage can be played back or not.

Returns
True if playback is allowed
DB_EDGEVIS_SDK bool EdgeVisDecoderSDK::ArchiveService::Recording ( ) const

Determines whether the archive is currently recording or not.

Returns
True if the archive is currently recording, false otherwise.
DB_EDGEVIS_SDK OpResult EdgeVisDecoderSDK::ArchiveService::SetRecording ( bool  rec)

Turns edge archive recording on or off.

Parameters
recTrue to enable DVR recording, false to disable it.
Returns
OpResult
  • OR_Success
  • OR_ConnectionFailed
  • OR_NotConnected (Encoder has disconnected)
  • OR_PermissionDenied (not allowed to get settings)
  • OR_EncoderNotSupported (Encoder is too old)
DB_EDGEVIS_SDK std::wstring EdgeVisDecoderSDK::ArchiveService::ArchiveType ( ) const

Gets the type of archive connected to the Encoder.

If no archive is configured on the Encoder then the resulting string will be "OFF".

Returns
The type of archive connected to the Encoder.
DB_EDGEVIS_SDK bool EdgeVisDecoderSDK::ArchiveService::ExternalArchiveEnabled ( ) const

Determines if the encoder is using an external archive device.

Returns
True if the encoder is configured to use an external archive device (e.g. X200), false if the encoder has an integrated archive or no archive device.
DB_EDGEVIS_SDK bool EdgeVisDecoderSDK::ArchiveService::Exists ( ) const

Determines if an archive device is connected to the Encoder and configured.

Returns
True if an archive device has been configured, false otherwise.
DB_EDGEVIS_SDK int32_t EdgeVisDecoderSDK::ArchiveService::MaxQueryDays ( ) const

Gets the maximum number of days that can be added to a filter when querying for hours from the archive.

Returns
The maximum number of days that can be added to a filter for an hours query.
DB_EDGEVIS_SDK int32_t EdgeVisDecoderSDK::ArchiveService::MaxQueryHours ( ) const

Gets the maximum number of hours that can be added to a filter when querying for minutes from the archive.

Returns
The maximum number of hours that can be added to a filter for an minutes query.
DB_EDGEVIS_SDK int32_t EdgeVisDecoderSDK::ArchiveService::MaxQuerySpanHours ( ) const

Returns the maximum span in hours that can be queried by QueryHours(start, end).

Returns
Maximum number of hours that can be queried in a single call.
DB_EDGEVIS_SDK int32_t EdgeVisDecoderSDK::ArchiveService::MaxQuerySpanMinutes ( ) const

Returns the maximum span in minutes that can be queried by QueryMinutes(start, end).

Returns
Maximum number of hours that can be queried in a single call.
DB_EDGEVIS_SDK size_t EdgeVisDecoderSDK::ArchiveService::QueryHours ( const int64_t  startTime,
const int64_t  endTime,
Timeline timeline 
)

Queries the archive for a list of hour timestamps for which there is footage available.

Parameters
startTimeThe UTC start of the timeframe for which the hours are being requested
endTimeThe UTC start of the timeframe for which the hours are being requested.
timelinePointer to the timeline object to be updated with the list of hours.
Note
The endtime will be clipped to MaxQuerySpanHours.
Returns
The number of hours found in the archive for the specified day. negative on error
  • OR_ConnectionFailed
  • OR_NotConnected
  • OR_PermissionDenied (not allowed to get settings)
  • OR_EncoderNotSupported (Encoder is too old)
DB_EDGEVIS_SDK size_t EdgeVisDecoderSDK::ArchiveService::QueryMinutes ( const int64_t  startTime,
const int64_t  endTime,
Timeline timeline 
)

Queries the archive for a list of minutes timestamps for which there is footage available.

Parameters
startTimeThe UTC start of the timeframe for which the minutes are being requested
endTimeThe UTC start of the timeframe for which the minutes are being requested.
timelinePointer to the timeline object to be updated with the list of hours.
Note
the endtime will be clipped to MaxQuerySpanMinutes.
Returns
The number of hours found in the archive for the specified day. negative on error
  • OR_ConnectionFailed
  • OR_NotConnected
  • OR_PermissionDenied (not allowed to get settings)
  • OR_EncoderNotSupported (Encoder is too old)
DB_EDGEVIS_SDK size_t EdgeVisDecoderSDK::ArchiveService::QueryDays ( Timeline timeline)

Queries the archive for a list of day timestamps for which there is footage available.

Parameters
timelinePointer to the timeline object to be updated with the list of days.
Returns
The number of days found in the archive. negative OpResult on error
  • OR_ConnectionFailed
  • OR_NotConnected
  • OR_PermissionDenied (not allowed to get settings)
  • OR_EncoderNotSupported (Encoder is too old)
DB_EDGEVIS_SDK size_t EdgeVisDecoderSDK::ArchiveService::QueryHours ( const int64_t  dayTs,
Timeline timeline 
)

Queries the archive for a list of hour timestamps for which there is footage available.

Parameters
dayTsThe day for which hours are being requested.
timelinePointer to the timeline object to be updated with the list of hours.
Returns
The number of hours found in the archive for the specified day. negative on error
  • OR_ConnectionFailed
  • OR_NotConnected
  • OR_PermissionDenied (not allowed to get settings)
  • OR_EncoderNotSupported (Encoder is too old)
DB_EDGEVIS_SDK size_t EdgeVisDecoderSDK::ArchiveService::QueryHours ( const Timeline::TimesList &  days,
Timeline timeline,
size_t  count = 0,
size_t  offset = 0 
)

Queries the archive for a list of hour timestamps for which there is footage available.

Parameters
daysA list of days for which hours are being requested.
timelinePointer to the timeline object to be updated with the list of hours.
countThe number of days from the days list to use.
offsetThe index into the days list to start at.
Returns
The number of hours found in the archive for the specified day. negative on error
  • OR_ConnectionFailed
  • OR_NotConnected
  • OR_PermissionDenied (not allowed to get settings)
  • OR_EncoderNotSupported (Encoder is too old)
DB_EDGEVIS_SDK size_t EdgeVisDecoderSDK::ArchiveService::QueryMins ( const int64_t  hourTs,
Timeline timeline 
)

Queries the archive for a list of minute timestamps for which there is footage available.

Parameters
hourTsThe hour for which minutes are being requested.
timelinePointer to the timeline object to be updated with the list of minutes.
Returns
The number of minutes found in the archive for the specified hour. negative on error
  • OR_ConnectionFailed
  • OR_NotConnected
  • OR_PermissionDenied (not allowed to get settings)
  • OR_EncoderNotSupported (Encoder is too old)
DB_EDGEVIS_SDK size_t EdgeVisDecoderSDK::ArchiveService::QueryMins ( const Timeline::TimesList &  hours,
Timeline timeline,
size_t  count = 0,
size_t  offset = 0 
)

Queries the archive for a list of minute timestamps for which there is footage available.

Parameters
hoursA list of hours for which minutes are being requested.
timelinePointer to the timeline object to be updated with the list of hours.
countThe number of hours from the hours list to use.
offsetThe index into the hours list to start at.
Returns
The number of minutes found in the archive for the specified hours. negative on error
  • OR_ConnectionFailed
  • OR_NotConnected
  • OR_PermissionDenied (not allowed to get settings)
  • OR_EncoderNotSupported (Encoder is too old)
DB_EDGEVIS_SDK OpResult EdgeVisDecoderSDK::ArchiveService::QueryRecordings ( const int64_t  startTime,
const int64_t  endTime,
const int32_t  input,
ArchiveRecordingInfo &  result 
)

Queries the archive for information on the available recordings.

The resulting list of available recordings can be used to control the archive playback or can be used to provide a time period for GOP download using the GOPDownloadService. Note this method requires a server version and encoder version greater than 6.5

Parameters
startTimeA UTC millisecond timestamp that the results shall start from.
endTimeA UTC millisecond timestamp that the results shall stop at.
inputThe video input index that the recording information shall be retrieved for.
resultThe ArchiveRecordingInfo object containing the result of the query.
Returns
OpResult
  • OR_Success
  • OR_ConnectionFailed
  • OR_NotConnected (Encoder has disconnected)
  • OR_PermissionDenied (not allowed to list recordings)
  • OR_EncoderNotSupported (Encoder is too old)
DB_EDGEVIS_SDK OpResult EdgeVisDecoderSDK::ArchiveService::QueryRecordings ( const int64_t  startTime,
const int64_t  endTime,
const int32_t  input,
const ArchiveFileSource  source,
ArchiveRecordingInfo &  result 
)

Queries the archive for information on the available recordings.

The resulting list of available recordings can be used to control the archive playback or can be used to provide a time period for GOP download using the GOPDownloadService. Note this method requires a server version and encoder version greater than 6.5

Parameters
startTimeA UTC millisecond timestamp that the results shall start from.
endTimeA UTC millisecond timestamp that the results shall stop at.
inputThe video input index that the recording information shall be retrieved for.
sourceThe sources to include in the query. Only AFS_EDGE is supported at this time.
resultThe ArchiveRecordingInfo object containing the result of the query.
Returns
OpResult
  • OR_Success
  • OR_ConnectionFailed
  • OR_NotConnected (Encoder has disconnected)
  • OR_PermissionDenied (not allowed to list recordings)
  • OR_EncoderNotSupported (Encoder is too old)
DB_EDGEVIS_SDK OpResult EdgeVisDecoderSDK::ArchiveService::QueryBookmarks ( std::vector< ArchiveBookmark > &  bookmarks)

Queries the archive for a list of bookmarks.

Parameters
bookmarksA vector to be populated with the available of bookmarks.
Returns
OpResult
  • OR_ConnectionFailed
  • OR_NotConnected
  • OR_PermissionDenied (not allowed to get settings)
  • OR_EncoderNotSupported (Encoder is too old)
DB_EDGEVIS_SDK OpResult EdgeVisDecoderSDK::ArchiveService::AddBookmark ( const int64_t  timestamp,
const int32_t  input,
const std::wstring &  name,
const std::wstring &  description,
ArchiveBookmark result 
)

Adds a new bookmark to the list of bookmarks on the Encoder.

Parameters
timestampThe timestamp to create the new bookmark for.
inputthe video input to create the new bookmark for.
nameThe name to use for the new bookmark.
descriptionAn optional description for the new bookmark. This may be an empty string.
resultThe newly created archive bookmark if successful.
Returns
OpResult
  • OR_Success
  • Query error codes (e.g. OR_ConnectionFailed)
  • OR_NotConnected (Encoder has disconnected)
  • OR_PermissionDenied (not allowed to get settings)
  • OR_EncoderNotSupported (Encoder is too old)
DB_EDGEVIS_SDK OpResult EdgeVisDecoderSDK::ArchiveService::DeleteBookmark ( const ArchiveBookmark bookmark)

Deletes a bookmark from the list of bookmarks on the Encoder.

Parameters
bookmarkThe bookmark to be deleted.
Returns
OpResult
  • OR_Success
  • OR_ConnectionFailed
  • OR_NotConnected (Encoder has disconnected)
  • OR_PermissionDenied (not allowed to get settings)
  • OR_EncoderNotSupported (Encoder is too old)
DB_EDGEVIS_SDK OpResult EdgeVisDecoderSDK::ArchiveService::StartPlayback ( const int64_t  ts)

Starts media playback from the specified timestamp.

If there is no footage on the archive for the specified time then the archive may go to the nearest footage before or after the specified time.

Parameters
tsThe timestamp of the footage to start playback at.
Returns
OpResult
  • OR_Success
  • OR_ConnectionFailed
  • OR_NotConnected (Encoder has disconnected)
  • OR_PermissionDenied (not allowed to get settings)
  • OR_EncoderNotSupported (Encoder is too old)
DB_EDGEVIS_SDK OpResult EdgeVisDecoderSDK::ArchiveService::StopPlayback ( )

Stops archive video playback.

If archive footage is not playing back this will have no effect.

Returns
OpResult
  • OR_Success
  • OR_ConnectionFailed
  • OR_NotConnected (Encoder has disconnected)
  • OR_PermissionDenied (not allowed to get settings)
  • OR_EncoderNotSupported (Encoder is too old)
DB_EDGEVIS_SDK OpResult EdgeVisDecoderSDK::ArchiveService::SetPlaybackSpeed ( ArchivePlaybackSpeed  speed)

Sets the archive playback speed to the specified speed.

Depending on the archive device calling this multiple times with the same speed option may increase the speed again.

Parameters
speedThe new archive playback speed.
Returns
OpResult
  • OR_Success
  • OR_ConnectionFailed
  • OR_NotConnected (Encoder has disconnected)
  • OR_PermissionDenied (not allowed to get settings)
  • OR_EncoderNotSupported (Encoder is too old)
DB_EDGEVIS_SDK ArchivePlaybackSpeed EdgeVisDecoderSDK::ArchiveService::GetPlaybackSpeed ( )

Get the speed of the archive playback.

Returns
The speed that the archive is playing back at.
DB_EDGEVIS_SDK ArchiveExporterService EdgeVisDecoderSDK::ArchiveService::GetExporterService ( )

Gets the ArchiveExporterService.

This can be used to list the actual files on the remote archive device and download them to obtain the footage at its original quality.

Returns
The ArchiveExporterService object.
DB_EDGEVIS_SDK GOPDownloadService EdgeVisDecoderSDK::ArchiveService::GetGOPDownloadService ( )

Gets the GOPDownloadService.

This can be used to retrieve footage from the remote archive device and download them to obtain the footage at its original quality.

Returns
The GOPDownloadService object.
DB_EDGEVIS_SDK bool EdgeVisDecoderSDK::ArchiveService::IsArchiveInUTC ( ) const

Determines if the archive is recording in UTC or local time.

Returns
True if the archive is recording in UTC, false if it is recording in local time.

- On error the return value of this function will default to true

DB_EDGEVIS_SDK bool EdgeVisDecoderSDK::ArchiveService::IsArchiveOwner ( ) const

Determines if the caller is the archive control owner.

Returns
True if the caller is the archive control owner.

The documentation for this class was generated from the following file: