我正在研究一个使用Azure Media Services Python SDK(v3)的项目。我有以下代码,一旦相关联的实时事件运行,它将创建实时输出和流定位器:
# Step 2: create a live output (used to reference the manifest file)
live_outputs = self.__media_services.live_outputs
config_data_live_output = LiveOutput(asset_name=live_output_name,archive_window_length=timedelta(minutes=30))
output = live_outputs.create(StreamHandlerAzureMS.RESOUCE_GROUP_NAME,StreamHandlerAzureMS.ACCOUNT_NAME,live_event_name,live_output_name,config_data_live_output)
# Step 3: get a streaming locator (the ID of the locator is used in the URL)
locators = self.__media_services.streaming_locators
config_data_streaming_locator = StreamingLocator(asset_name=locator_name)
locator = locators.create(StreamHandlerAzureMS.RESOUCE_GROUP_NAME,locator_name,config_data_streaming_locator)
self.__media_services
是类型AzureMediaServices
的对象。当我运行上面的代码时,我收到以下异常:
azure.mgmt.media.models._models_py3.ApiErrorException: (ResourceNotFound) Live Output asset was not found.
问题::Azure Media Services为什么在创建资源的操作中抛出此错误?我该如何解决这个问题?
请注意,我已经成功使用服务主体对SDK进行了Azure媒体服务的身份验证,并且可以使用ffmpeg成功地将视频推送到现场活动。