Unable to Add video files to the index

Tushar Gupta 40 Reputation points
2024-01-31T10:40:31.09+00:00

I am trying to follow the steps mentioned in the https://video2.skills-academy.com/en-us/azure/ai-services/computer-vision/how-to/video-retrieval

I am able to execute the step1 but at step 2 I am facing issue. My blob storage contains the mp4 file and below is the body I am passing to my postman request:

{
  'videos': [
    {
      'mode': 'add',
      'documentId': '02a504c9cd28296a8b74394ed7488045',
      'documentUrl': 'https://genaixxxxstroage.blob.core.windows.net/uploadvideostorage/579cdd09-597c-41be-997c-c17aff6f19d5.mp4?sp=r&st=2024-01-31T07:10:37Z&se=2024-01-31T15:10:37Z&sv=2022-11-02&sr=b&sig=X5EvHEKxxxxxxxxxxxxIqJVDSPxwitLSt3FWic%3D',
      'metadata': {
        'cameraId': 'camera1',
        'timestamp': '2024-01-31 2:40:33'
      }
    },
    {
      'mode': 'add',
      'documentId': '043ad56daad86cdaa6e493aa11ebdab3',
      'documentUrl': '[https://genaixxxxxstroage.blob.core.windows.net/uploadvideostorage/579cdd09-597c-41be-997c-c17aff6f19d5.mp4?sp=r&st=2024-01-31T07:10:37Z&se=2024-01-31T15:10:37Z&sv=2022-11-02&sr=b&sig=X5EvHEsssxxxxxxxxxJVDSPxwitLSt3FWic%3D',
      'metadata': {
        'cameraId': 'camera2'
      }
    }
  ]
}

I am getting below error:

{
    "error": {
        "code": "InvalidRequest",
        "message": "Value for videos[0].documentUrl.videos is invalid."
    }
}
Azure Computer Vision
Azure Computer Vision
An Azure artificial intelligence service that analyzes content in images and video.
338 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,583 questions
{count} votes

Accepted answer
  1. dupammi 7,955 Reputation points Microsoft Vendor
    2024-01-31T14:30:27.2433333+00:00

    Hi @Tushar Gupta ,

    Thank you for using the Microsoft Q&A forum.

    The error message "Value for videos[0].documentUrl.videos is invalid" suggests that there is an issue with the structure of the request body for Step 2. So, please re-check your provided request body in postman PUT request. There were Mismatched Brackets in the documentUrl of the Second Video. It looks like there might be some characters in the URL that need encoding, but it's hard to tell without seeing the actual URL content.

    After making these adjustments, try the request again and see if the issue persists. If the problem persists, double-check the URL encoding and make sure there are no other syntax errors in the request body.

    For debugging purpose, I tried to repro and was able to get a success response. Please find below repro in postman :

    User's image

    Please refer below postman body content that worked for me.

    {
    
      "videos": [
    
        {
    
          "mode": "add",
    
          "documentId": "02a504c9cd28296a8b74394ed7488045",
    
          "documentUrl": "https://<YOUR_ENDPOINT_URL>.blob.core.windows.net/d98be185-c266-4639-8558-b7c425705efc-azureml-blobstore/big_buck_bunny_720p_1mb.mp4",
    
          "metadata": {
    
            "cameraId": "camera1",
    
            "timestamp": "2023-06-30 17:40:33"
    
          }
    
        }
    
      ]
    
    }
    
    

    Output:

    User's image

    Hope this helps.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful