AI Bridge - Snapshot at time

Hi there,

I was wondering if there’s a feature I’ve missed somewhere in the documentation to get a snapshot of a camera at a certain time? This is a heavily used feature for us, and I see in the gRPC documentation, there is this:

message SnapshotRequest
{
    // ID of stream to take snapshot from.
    string stream_id = 1;

    // Maximum width in pixels of snapshot image.
    uint32 max_width = 2;

    // Maximum height in pixels of snapshot image.
    uint32 max_height = 3;

    // Token by which to authorize access to snapshot; leave blank to use
    // default authorization.
    string token = 4;
}

There appears to be an equivalent in the GraphQL schema too. Neither appear to have the ability to specify a timestamp?

This was previously a pretty easy thing to do using the ImageServer API:

<?xml version="1.0"  encoding="UTF-8"?>
<methodcall>
  <methodname>connect</methodname>
  <!-- Return as JPEG, rather than raw camera data -->
  <alwaysstdjpeg>yes</alwaysstdjpeg>
</methodcall>

Then

<methodcall>
  <requestid>1005</requestid>
  <methodname>goto</methodname>
  <time>1772593334416</time>
  <keyframesonly>no</keyframesonly>
</methodcall>

And a JPEG at that time would be returned. Usually <100ms in my experience. Sometimes <30ms.

The only equivalent way in the AI Bridge I’ve found (so far) is to:

  • Initiate a playback stream around the time I’d like the screenshot taken (PlaybackStream)
  • Receive the raw camera frames (h264/hevc), going back to the nearest keyframe
  • Decode these frames using another method and calculate which frame is the closest to what is desired

This seems incredibly manual and error prone, and time consuming (>600ms in most cases).

Is there another method that can be used? Or if not, is it a feature which would be considered in the future?

Hi @bevans_vc ,

Currently that feature is not supported by AI Bridge.

I will bring this to our PM, but I can’t promise anything coming soon about this.