Skip to content

media sdk playback sequence querier

Andre Lafleur edited this page Oct 8, 2026 · 4 revisions

About PlaybackSequenceQuerier

PlaybackSequenceQuerier returns the time ranges where recordings exist for a camera, an audio stream, or a metadata stream. It does not read frames; for that, use PlaybackStreamReader.

Run a query before connecting a PlaybackStreamReader so the reader does not start at a time where no archive data exists, and so a timeline UI can show recording regions accurately.

How querying works

Create a querier through one of three factory methods: CreateVideoQuerier, CreateAudioQuerier, or CreateQuerier. Call QuerySequencesAsync(DateTimeRange) for merged recording ranges, or QuerySequencesBySourcesAsync(DateTimeRange) when the camera has recordings on more than one playback source.

Both query methods are async. The querier exposes DisposeAsync(), which returns Task, for asynchronous disposal. Use a try block and call await querier.DisposeAsync() in its finally block to release the querier.

PlaybackSequenceQuerier

using Genetec.Sdk.Media;
using Genetec.Sdk.Media.Reader;

PlaybackSequenceQuerier querier =
    PlaybackSequenceQuerier.CreateVideoQuerier(engine, cameraGuid);

try
{
    var range = new DateTimeRange(startTimeUtc, endTimeUtc);

    List<PlaybackSequence> sequences =
        await querier.QuerySequencesAsync(range);
}
finally
{
    await querier.DisposeAsync();
}

Factory methods

Method Use it for
CreateVideoQuerier(IEngine, Guid cameraGuid) Camera video recordings.
CreateAudioQuerier(IEngine, Guid cameraGuid) Camera audio recordings.
CreateQuerier(IEngine, Guid cameraGuid, Guid streamGuid) A specific metadata stream associated with the camera.

All three return a querier ready to be queried. Time values passed to QuerySequencesAsync are UTC.

Querying merged ranges

QuerySequencesAsync(DateTimeRange) returns a list of PlaybackSequence ranges for the requested time window, merged across playback sources. Use this when the application only needs to know when recording exists.

PlaybackSequence exposes a single Range property of type DateTimeRange that contains the start and end times of a continuous recorded segment.

Querying by playback source

A camera can record to more than one playback source, such as an Archiver or Auxiliary Archiver. When the application needs source-level information, use QuerySequencesBySourcesAsync:

List<PlaybackSource> sources =
    await querier.QuerySequencesBySourcesAsync(range);

foreach (PlaybackSource source in sources)
{
    Guid playbackSourceGuid = source.PlaybackSourceGuid;
    bool isOnline = source.IsOnline;
    IReadOnlyList<PlaybackSequence> sourceSequences = source.Sequences;
}

The returned list contains every playback source configured for the camera, including sources with no recordings in the requested range. Those entries have an empty Sequences list rather than null. IsOnline reflects whether the source was reachable at the moment of the query.

PlaybackSource member Description
PlaybackSourceGuid Identity of the playback source.
IsOnline true when the source is currently online and reachable.
Sequences Recorded segments contributed by this source within the queried range.

Use PlaybackSourceGuid when constructing a PlaybackStreamReader that must read from one specific source rather than across all sources.

Disposing

PlaybackSequenceQuerier exposes DisposeAsync() returning a Task. Use await querier.DisposeAsync() to release resources.

See also

Platform SDK

Plugin SDK

Workspace SDK

Media SDK

Macro SDK

Web SDK

Synergis RIO

Media Gateway

Genetec Web Player

Clone this wiki locally