Skip to main content

UpdateVideo

Updates existing Video objects that satisfy the specified constraints.

Parameters

Details

If the ref parameter is used, constraints will be ignored.

If the ref parameter is specified, it must refer to the search result 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 unless these are remote videos. Remote videos are not updated and the query returns with an error.

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"]
}
}]

Successful response:


[{
"UpdateVideo": {
"count": 1,
"status": 0
}
}]

Update the "focal_length_mm" property for the videos that are connected to an entity of the class "Dataset" and with a property "name" equal to "Youtube":


[{
"FindEntity": {
"with_class": "Dataset",
"_ref": 1,
"constraints": {
"name": ["==", "Youtube"]
}
}
}, {
"FindVideo": {
"_ref": 2,
"is_connected_to": {
"ref": 1,
"connection_class": "in_dataset"
},
"blobs": false
}
}, {
"UpdateVideo": {
"ref": 2,
"properties": {
"focal_length_mm": 55
}
}
}]

Successful response:


[{
"FindEntity": {
"returned": 0,
"status": 0
}
}, {
"FindVideo": {
"returned": 0,
"status": 0
}
}, {
"UpdateVideo": {
"count": 1,
"status": 0
}
}]