FindClip
Find clips that satisfy the specified constraints.
This command enables visual operations, using the operations parameter.
Clips can be requested by specifying "blobs": True
,
in which case they 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] constraints
- [optional] is_connected_to
- [optional] group_by_source
- [optional] results
- [optional] batch
- [optional] sort
- [optional] limit
- [optional] offset
- [optional] uniqueids: indicates whether unique ids will be returned as part of the response (Default: false).
- [optional] with_label
- [optional] video_ref: Reference to a video which the clip links to.
- [optional] blobs: indicates whether the blobs will be returned (Default: false).
- [optional] as_container: Specifies the container in which the video clip will be returned.
- [optional] as_codec: Specifies the codec in which the video clip will be returned.
- [optional] in_frame_number_range
- [optional] in_time_offset_range
- [optional] in_time_fraction_range
- [optional] operations: operations to apply to video
Details
Only one of in_frame_number_range
, in_time_offset_range
or in_time_fraction_range
is supported at a time. For finding a clip, one or both of start and stop may be defined.
Operations defined in operations will be performed on-the-fly and will not affect the original video stored in ApertureDB.
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. Similarly, if the video_ref parameter is used, the results can be grouped by the source video. The parameter is ignored if neither is_connected_to nor video_ref is used. It is set to false by default.
If in_..._range is specified, the clips returned must be fully within the boundaries indicated by the given parameters.
Examples
Finds clips based on scene names for given video, returning the duration of the clip:
[{
"FindVideo": {
"_ref": 1,
"constraints": {
"name": ["==", "The Shining"]
}
}
}, {
"FindClip": {
"video_ref": 1,
"constraints": {
"name": ["==", "Girls In Blue"]
},
"results": {
"all_properties": true
}
}
}]
Successful response:
[{
"FindVideo": {
"returned": 0,
"status": 0
}
}, {
"FindClip": {
"status": 0,
"returned": 1,
"entities": [{
"_range_type": 3,
"_range_start": 1283000000,
"_range_stop": 1330000000,
"_time_offset_range": {
"start": "21:23.0",
"stop": "22:10.0"
},
"name": "Girls In Blue",
"_uniqueid": "2.0.42"
}]
}
}]
Find multiple clips based on the time that they are within the video, return the name of matching clips ( assuming the clips have a property, name )
[{
"FindVideo": {
"_ref": 1,
"constraints": {
"name": ["==", "The Shining"]
}
}
}, {
"FindClip": {
"video_ref": 1,
"in_time_offset_range": {
"start": "28:00",
"stop": "36:00"
},
"results": {
"list": ["name"]
}
}
}]
Successful response:
[{
"FindVideo": {
"returned": 0,
"status": 0
}
}, {
"FindClip": {
"status": 0,
"returned": 1,
"entities": [{
"name": "Room 237"
}]
}
}]
Find multiple clips based on the time fraction that they are within the video, return the name of matching clips ( assuming the clips have a property, name ). This example gets all clips in the first 35% ( regardless of frame count ) of the video.
[{
"FindVideo": {
"_ref": 1,
"constraints": {
"name": ["==", "The Shining"]
}
}
}, {
"FindClip": {
"video_ref": 1,
"in_time_fraction_range": {
"start": 0,
"stop": 0.35
},
"results": {
"list": ["name"]
}
}
}]
Successful response:
[{
"FindVideo": {
"returned": 0,
"status": 0
}
}, {
"FindClip": {
"status": 0,
"returned": 2,
"entities": [{
"name": "Isolated Island"
}, {
"name": "The Lodge"
}]
}
}]