FindVideo

Find videos that satisfy the specified constraints.

Parameters

  • [optional] _ref: Reference to be used within the transaction.
  • [optional] unique: Indicates whether a single object is expected to satisfy the constraints.
  • [optional] codec: Specifies the codec in which the video will be returned.
  • [optional] container: Specifies the container in which the video will be returned.

Blocks

Details

Operations defined in the operations block 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 “blob” flag to “false” in the results block.

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": {
        "class": "Category",
        "_ref": 1,
        "unique": true,
        "constraints": {
            "name": ["==", "Comedy"]
        }
    }
},{
    "FindVideo": {
        "codec": "h264",
        "container": "mp4",
        "link": {
            "ref": 1,
        },
        "operations": [
            {
                "type": "interval",
                "start": 0,
                "end": 100,
                "step": 1
            },
            {
                "type": "resize",
                "width": 1920,
                "height": 1080,
            }
        ]
    }
} ]