I am using following nodejs code to retrieve operation instance of video annotation request
var vidOptions = {
"inputUri": gCloudURL,
"features": [ 'LABEL_DETECTION' ]
};
client.annotateVideo(vidOptions).then(function(results){
//console.log(results[0].name);
//return JSON.stringify(results[0].name);
const operation = results[0];
res.json(operation);
//console.log('Waiting for operation to complete...');
//return operation.promise();
})
But once I have operation name which function / library i need to call to get operation status and results. Videos might be lnong duration. Hence I dont want to rely on promise. Rather in 1st Call I initiate video annotation. In 2nd call I run a for loop and keep checking if videoannotation operation is finished?
BTW AWS rekognition rocks when it comes to this, they allow integration with SNS so you automatically recieve an event when video processing finishes and you avoid all overhead of polling from client side. Doesnt GCP has similar feature?