UpdateClip
Updates existing Clip objects that satisfy the specified constraints.
Parameters
- [optional] ref: Reference to other Clips within the transaction.
- [optional] constraints
- [optional] properties
- [optional] remove_props
- [optional] label
- [optional] frame_number_range: position range in a video expressed as frames.
- [optional] time_offset_range: position range in a video expressed as times since video start.
- [optional] time_fraction_range: position range in a video expressed as a fraction of video duration.
Details
If the ref parameter is used, constraints will act as additional filters on the referenced result set.
If the ref parameter is specified, it must refer to the search results of a previous FindClip.
For more complex searches for objects to update, a Find command must be used first within the transaction.
Examples
Find the clips with the "name" property equal to "The Lodge", and update the label and the time fraction range:
[{
"UpdateClip": {
"constraints": {
"name": ["==", "The Lodge"]
},
"label": "Building",
"time_fraction_range": {
"start": 0.5,
"stop": 0.6
}
}
}]
Successful response:
[{
"UpdateClip": {
"count": 1,
"status": 0
}
}]
Find the clips connected to the video with "name" = "The Shining", and update "year" property to 1980
[{
"FindVideo": {
"_ref": 1,
"constraints": {
"name": ["==", "The Shining"]
}
}
}, {
"FindClip": {
"video_ref": 1,
"_ref": 2
}
}, {
"UpdateClip": {
"ref": 2,
"properties": {
"year": 1980
}
}
}]
Successful response:
[{
"FindVideo": {
"returned": 0,
"status": 0
}
}, {
"FindClip": {
"returned": 0,
"status": 0
}
}, {
"UpdateClip": {
"count": 4,
"status": 0
}
}]