UpdateVideo
Updates existing Video objects that satisfy the specified constraints.
Parameters
[optional] ref: Reference to other entities within the transaction.
[optional] constraints
[optional] properties
[optional] remove_props
[optional] codec
[optional] operations
Details
If the ref parameter is used, constraints will be ignored.
If the ref parameter is specified, it must refers to the search results of a previous FindVideo.
If the codec parameter is specified, the videos will be re-encoded. Similarly, if operations are specified, the videos will be transformed using the specified operations.
For more complex searches for objects to delete, a Find command must be used first within the transaction.
Examples
Find the videos with the “year_captured” property equal to 2007, and remove the “focal_length” property:
[ {
"UpdateVideo": {
"constraints": {
"year_captured": [ "==", 2007 ],
},
"remove_props": [ "focal_length" ]
}
}]
Find an video with the “year_captured” property equal to 2007, verify that only one video satisfy the constraint, update the “focal_length_mm” property, re-encode the video as H.264, and resize them to 224x224:
[ {
"UpdateVideo": {
"unique": true,
"constraints": {
"year_captured": [ "==", 2007 ],
},
"properties": {
"focal_length_mm": 55
},
"codec": "h264",
"operations": [
{
"type": "resize",
"width": 224,
"height": 224
}
]
}
}]
Resize to 224x224 all the videos that are connected to an entity of the class “Dataset” and with a property “name” equal to “Youtube”:
[ {
"FindEntity": {
"class": "Dataset",
"_ref": 1,
"constraints": {
"name": ["==", "Youtube"]
}
}
}, {
"FindVideo": {
"_ref": 2,
"is_connected_to": {
"ref": 1,
"class": "in_dataset"
},
"blobs": false
}
}, {
"UpdateVideo": {
"ref": 2,
"operations": [
{
"type": "resize",
"width": 224,
"height": 224
}
]
}
}]