Azure AI Video Indexer
An Azure video analytics service that uses AI to extract actionable insights from stored videos.
69 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
This is the code I am using in Python to upload a video and search for frames using natural language. I understand that this code does not do the latter but I am getting an error message from before the default insights can be generated.
# imports
from dotenv import dotenv_values
from pprint import pprint
from VideoIndexerClient.Consts import Consts
from VideoIndexerClient.VideoIndexerClient import VideoIndexerClient
config = dotenv_values(".env")
AccountName = config.get('AccountName')
ResourceGroup = config.get('ResourceGroup')
SubscriptionId = config.get('SubscriptionId')
ApiVersion = '2024-01-01'
ApiEndpoint = 'https://api.videoindexer.ai'
AzureResourceManager = 'https://management.azure.com'
# create and validate consts
consts = Consts(ApiVersion, ApiEndpoint, AzureResourceManager, AccountName, ResourceGroup, SubscriptionId)
# Authenticate
# create Video Indexer Client
client = VideoIndexerClient()
# Get access tokens (arm and Video Indexer account)
client.authenticate_async(consts)
client.get_account_async()
# VideoUrl = 'YOUR_VIDEO_URL'
ExcludedAI = []
# video_id = client.upload_url_async('my-video-name', VideoUrl, ExcludedAI, False)
LocalVideoPath = 'water_damage_demo.mp4'
file_video_id = client.file_upload_async(LocalVideoPath, video_name=None, excluded_ai=ExcludedAI)
client.wait_for_index_async(file_video_id)
insights = client.get_video_async(file_video_id)
pprint(insights)
# client.get_insights_widgets_url_async(video_id, widget_type='Keywords')
# client.get_player_widget_url_async(video_id)
prompt_content = client.get_prompt_content(file_video_id)
pprint(prompt_content)
I have used the credentials for Accountname, Resourcegroup and subscription ID as per the resource group created from Azure Portal. This is the error I get. How do I resolve this?
[Account Details] Id:<accountID>, Location: eastus Uploading a local file using multipart/form-data post request.. Traceback (most recent call last): File "c:\Users\Admin\Desktop\project\test_azure.py", line 36, in <module> file_video_id = client.file_upload_async(LocalVideoPath, video_name=None, excluded_ai=ExcludedAI) File "c:\Users\Admin\Desktop\project\VideoIndexerClient\VideoIndexerClient.py", line 142, in file_upload_async response.raise_for_status() File "C:\Users\Admin\Desktop\project\videnvrobo\lib\site-packages\requests\models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 424 Client Error: Failed Dependency for url: https://api.videoindexer.ai/eastus/Accounts/<accountID>/Videos?accessToken=<accesstokenstring>&name=water_damage_demo&description=&privacy=private&partition=
**Authentication**:
AccountName
, ResourceGroup
, SubscriptionId
) are correctly set in your .env
file and are being correctly read into your Python script.accessToken
, accountID
, and other required parameters are correctly configured and valid at the time of the request.