I am using Google Cloud Video Intelligence API to fetch the details from the video. I am sending the video as base64 in the body to the cloud with the API below.
https://videointelligence.googleapis.com/v1/videos:annotate?key=xxxxxxx
Response: { "name": "projects/xxxxxxxxxx/locations/asia-east1/operations/xxxxxxx" }
With this response, I'm hitting another API to mining the video. I store the value of "name"
from the response in a variable called name
and assigning the variable to the second API like this.
Second API: final name = "https://videointelligence.googleapis.com/v1/$name?key=xxxxxxxxxxxx";
Making it dynamic URL and it's returning very minimal value in the response.
Response When Dynamic:
{name: projects/xxxxxxxxxxxx/locations/asia-east1/operations/xxxxxxxxxxxxx, metadata: {@type: type.googleapis.com/google.cloud.videointelligence.v1.AnnotateVideoProgress, annotationProgress: [{startTime: 2022-11-23T09:43:12.213455Z, updateTime: 2022-11-23T09:43:12.213455Z}]}}
But when I print the URL in the console and paste it directly to the URL param in the dio. it gives the correct response.
Response response = await Dio.get(https://videointelligence.googleapis.com/v1/projects/xxxxxxxxx/locations/asia-east1/operations/xxxxxxxxxxx?key=xxxxxxxxx)
And I'm getting response like this.
Response When Static:
{name: projects/xxxxxxxxxxxx/locations/asia-east1/operations/xxxxxxxxxx, metadata: {@type: type.googleapis.com/google.cloud.videointelligence.v1.AnnotateVideoProgress, annotationProgress: [{progressPercent: 100, startTime: 2022-11-23T08:28:24.262287Z, updateTime: 2022-11-23T08:28:32.231464Z}]}, done: true, response: {@type: type.googleapis.com/google.cloud.videointelligence.v1.AnnotateVideoResponse, annotationResults: [{segmentLabelAnnotations: [{entity: {entityId: /m/01y9k5, description: desk, languageCode: en-US}, categoryEntities: [{entityId: /m/0c_jw, description: furniture, languageCode: en-US}], segments: [{segment: {startTimeOffset: 0s, endTimeOffset: 7.525s}, confidence: 0.50800985}]}, {entity: {entityId: /m/021sj1, description: office, languageCode: en-US}, categoryEntities: [{entityId: /m/0cgh4, description: building, languageCode: en-US}], segments: [{segment: {startTimeOffset: 0s, endTimeOffset: 7.525s}, confidence: 0.41025674}]}], shotLabelAnnotations: [{entity: {entityId: /m/01y9k5, description: desk, languageCode: en-US}, categoryEntities: [{entityId: /m/0c_jw, description: furniture, languageCode: en-US}], segments: [{segment: {startTimeOffset: 0s, endTimeOffset: 7.525s}, confidence: 0.50800985}]}], segment: {startTimeOffset: 0s, endTimeOffset: 7.525s}}]}}
I am not sure why this is happening. when the URL is dynamic it gives very less details and when it was static it gives much more details about the video that I want to mining.
I have also used the GetConnect().get() thought the problem is with the dio package. But the result is same. Can anybody tell what exactly going wrong and how should I solve this issue.