FindVideo

Find videos that satisfy the specified constraints.

This command enables visual operations, using the operations parameter.

Videos are returned as blobs in the array of blobs.

Parameters

  • [optional] _ref: Reference to be used within the transaction.
  • [optional] unique: Indicates whether a single object is expected to satisfy the constraints.
  • [optional] as_codec: Specifies the codec in which the video will be returned.
  • [optional] as_container: Specifies the container in which the video will be returned.
  • [optional] blobs: indicates whether the blobs will be returned as part of the response (Default: true).
  • [optional] constraints
  • [optional] is_connected_to
  • [optional] group_by_source
  • [optional] results
  • [optional] operations
  • [optional] batch

Details

Operations defined in operations will be performed on-the-fly and will not affect the original video stored in ApertureDB.

By default, the blob corresponding to the encoded video will be returned in the array of blobs:. It is possible to specify the blob not to be returned by setting the “blobs” parameter to “false”.

If only one ref parameter is used in the is_connected_to array, the resulting objects obtained after traversing the given connection can be associated with their source objects by specifying the parameter group_by_source as true. The parameter is ignored if is_connected_to is absent. It is set to false by default.

Examples

Retrieve all videos with a “duration_min” less that “5”, in 1080p resolution. Encode the videos using H.264 and a MP4 container:

[ {
    "FindVideo": {
        "codec": "h264",
        "container": "mp4",
        "constraints" : {
            "duration_min" : ["<=", 5},
        },
        "operations": [
            {
                "type": "resize",
                "width": 1920,
                "height": 1080,
            }
        ]
    }
} ]

Retrieve the first 100 frames of all videos that have a connection to an Entity of the class “Category” where the “name” property is “Comedy”, in 1080p resolution. Encode the videos using H.264 and a MP4 container:

[ {
    "FindEntity": {
        "with_class": "Category",
        "_ref": 1,
        "unique": true,
        "constraints": {
            "name": ["==", "Comedy"]
        }
    }
},{
    "FindVideo": {
        "codec": "h264",
        "container": "mp4",
        "is_connected_to": {
            "ref": 1,
        },
        "operations": [
            {
                "type": "interval",
                "start": 0,
                "end": 100,
                "step": 1
            },
            {
                "type": "resize",
                "width": 1920,
                "height": 1080,
            }
        ]
    }
} ]