FindFrames

Find frames in previously added videos that satisfy the specified constraints.

Frames are returned as encoded images in the array of blobs.

Parameters

  • frames: Array of frame indexes.
  • [optional] _ref: Reference to be used within the transaction.
  • [optional] unique: Indicates whether a single video is expected to satisfy the constraints.
  • [optional] format: Specify the format of the returned image.

Blocks

Details

The images to be returned can be specified in two ways: either by specifying the frames parameter, or by passing an “interval” as part of operations block. The command fails in presence of both the frames parameter and the “interval” operations, or in absence of neither one of them.

Note that the interval parameter is not supported by commands that operate on images. This is an exception for this command, as the interval parameter is used as means to specify the list of frames.

Examples

Find the video with the “name” property equal to “my_video_1”, and returns 1st, 10th, and 100th frames of it:

[ {
      "FindFrames": {
          "frames" : [0, 9, 99],
          "unique": true,
          "constraints" : {
              "name" : ["==", "my_video_1"},
          }
      }
}]

Find the video with the “name” property equal to “my_video_1”, and return 1 every 5 frames in the range between the 1st and the 100th frame with 1080p resolution as “PNG”:

[ {
    "FindFrames": {
        "constraints" : {
            "name" : ["==", "Family Guy"},
        },
        "unique": true,
        "format": "png",
        "operations": [
            {
                "type": "interval",
                "start": 0,
                "stop" : 99,
                "step" : 5
            },
            {
                "type": "resize",
                "width":  1920,
                "height": 1080
            }
        ]
    }
}]