Microsoft Azure Media Services Python客户端库
项目描述
Microsoft Azure SDK for Python
这是Microsoft Azure Media Services客户端库。此软件包已与Python 3.7+进行测试。有关Azure库的更完整视图,请参阅azure sdk python发布。
免责声明
Azure SDK Python包对Python 2.7的支持已于2022年1月1日结束。有关更多信息及问题,请参阅https://github.com/Azure/azure-sdk-for-python/issues/20691
开始使用
先决条件
- 使用此包需要 Python 3.7+。
- Azure 订阅
安装包
pip install azure-mgmt-media
pip install azure-identity
身份验证
默认情况下,Azure Active Directory 令牌身份验证依赖于以下环境变量配置正确。
AZURE_CLIENT_ID
用于 Azure 客户端 ID。AZURE_TENANT_ID
用于 Azure 租户 ID。AZURE_CLIENT_SECRET
用于 Azure 客户端密钥。
此外,可以通过环境变量 AZURE_SUBSCRIPTION_ID
配置 Azure 订阅 ID。
以上配置后,客户端可以通过以下代码进行身份验证
from azure.identity import DefaultAzureCredential
from azure.mgmt.media import MediaManagementClient
import os
sub_id = os.getenv("AZURE_SUBSCRIPTION_ID")
client = MediaManagementClient(credential=DefaultAzureCredential(), subscription_id=sub_id)
示例
此包的代码示例可以在 docs.microsoft.com 上的 Media Services 和 Samples Repo 找到
故障排除
下一步
提供反馈
如果您遇到任何错误或有一些建议,请在项目的 Issues 部分提交问题。
版本历史
10.2.0 (2023-01-12)
新增功能
- Model Filters 新增参数 fade_in
- Model Filters 新增参数 fade_out
- Model StandardEncoderPreset 新增参数 experimental_options
10.2.0b1 (2022-12-27)
其他更改
- 在 github 仓库中添加了生成示例
- 放弃对 python<3.7.0 的支持
10.1.0 (2022-09-14)
新增功能
- 添加了操作 LiveEventsOperations.async_operation
- 添加了操作 LiveEventsOperations.operation_location
- 添加了操作 LiveOutputsOperations.async_operation
- 添加了操作 LiveOutputsOperations.operation_location
- 添加了操作 StreamingEndpointsOperations.async_operation
- 添加了操作 StreamingEndpointsOperations.operation_location
- Model AudioTrack 新增参数 bit_rate
- Model AudioTrack 新增参数 dash_settings
- Model AudioTrack 新增参数 display_name
- Model AudioTrack 新增参数 file_name
- Model AudioTrack 新增参数 hls_settings
- Model AudioTrack 新增参数 language_code
- Model AudioTrack 新增参数 mpeg4_track_id
- Model CommonEncryptionCbcs 新增参数 clear_key_encryption_configuration
- Model CommonEncryptionCenc 新增参数 clear_key_encryption_configuration
- Model ContentKeyPolicyPlayReadyLicense 新增参数 security_level
- Model LiveOutput 新增参数 rewind_window_length
10.0.0 (2022-07-01)
功能
- 添加了操作 MediaservicesOperations.begin_create_or_update
- 添加了操作 MediaservicesOperations.begin_update
- 添加了操作组 MediaServicesOperationResultsOperations
- 添加了操作组 MediaServicesOperationStatusesOperations
- Model MediaService 新增参数 private_endpoint_connections
- Model MediaService 新增参数 provisioning_state
- Model MediaServiceUpdate 新增参数 private_endpoint_connections
- Model MediaServiceUpdate 新增参数 provisioning_state
重大更改
- 删除了操作 MediaservicesOperations.create_or_update
- 删除了操作 MediaservicesOperations.update
9.0.0 (2022-03-30)
功能
- 添加了操作 StreamingEndpointsOperations.skus
- 添加了操作组 OperationResultsOperations
- 添加了操作组 OperationStatusesOperations
- 添加了操作组 TracksOperations
- Model H264Layer 新增参数 crf
- Model H264Video 新增参数 rate_control_mode
- Model H265Layer 新增参数 crf
- Model StreamingEndpoint 新增参数 sku
重大更改
- Model H264Layer 不再具有参数 odata_type
- Model H265Layer 不再具有参数 odata_type
- Model H265VideoLayer 不再具有参数 odata_type
- Model JpgLayer 不再具有参数 odata_type
- Model Layer 不再具有参数 odata_type
- Model PngLayer 不再具有参数 odata_type
- Model VideoLayer 不再具有参数 odata_type
8.0.0 (2021-07-15)
功能
- Model JobOutput 新增参数 preset_override
- Model BuiltInStandardEncoderPreset 新增参数 configurations
- Model MediaServiceIdentity 新增参数 user_assigned_identities
- Model JobOutputAsset 新增参数 preset_override
- Model MediaService 新增参数 public_network_access
- Model MediaServiceUpdate 添加了新参数 public_network_access
- Model StorageAccount 添加了新参数 status
- Model StorageAccount 添加了新参数 identity
- Model AccountEncryption 添加了新参数 status
- Model AccountEncryption 添加了新参数 identity
- Model LiveOutput 添加了新参数 system_data
重大更改
- Model OperationCollection 不再具有参数 odata_next_link
7.0.0 (2021-06-03)
功能
- Model Asset 添加了新参数 system_data
- Model StreamingPolicy 添加了新参数 system_data
- Model Operation 添加了新参数 action_type
- Model Operation 添加了新参数 is_data_action
- Model JobInputAsset 添加了新参数 input_definitions
- Model AccountFilter 添加了新参数 system_data
- Model FaceDetectorPreset 添加了新参数 mode
- Model FaceDetectorPreset 添加了新参数 blur_type
- Model LiveEvent 添加了新参数 system_data
- Model MediaService 添加了新参数 key_delivery
- Model MediaService 添加了新参数 system_data
- Model Job 添加了新参数 system_data
- Model StreamingLocator 添加了新参数 system_data
- Model StreamingEndpoint 添加了新参数 system_data
- Model ContentKeyPolicy 添加了新参数 system_data
- Model JobInputClip 添加了新参数 input_definitions
- Model JobInputHttp 添加了新参数 input_definitions
- Model MetricSpecification 添加了新参数 lock_aggregation_type
- Model MetricSpecification 添加了新参数 supported_time_grain_types
- Model MetricSpecification 添加了新参数 source_mdm_namespace
- Model MetricSpecification 添加了新参数 source_mdm_account
- Model MetricSpecification 添加了新参数 enable_regional_mdm_account
- Model AssetFilter 添加了新参数 system_data
- Model Transform 添加了新参数 system_data
重大更改
- 移除了操作 MediaservicesOperations.get_by_subscription
7.0.0b1 (2020-12-01)
这是测试预览版本。
本版本使用下一代代码生成器,引入了重要的破坏性变更,但也引入了重要的新功能(如统一身份验证和异步编程)。
一般破坏性变更
-
凭证系统已完全改版
azure.common.credentials
或msrestazure.azure_active_directory
实例不再受支持,请使用azure-identity
类: https://pypi.ac.cn/project/azure-identity/credentials
参数已重命名为credential
-
客户端上的
config
属性不再存在,配置应作为 kwarg 传递。例如:MyClient(credential, subscription_id, enable_logging=True)
。有关完整选项集,请参阅 azure-core 初始化文档中接受的参数 -
您不能再导入
version
模块,请使用__version__
代替 -
之前返回
msrest.polling.LROPoller
的操作现在返回azure.core.polling.LROPoller
,并以前缀begin_
开头。 -
异常树已简化,大多数异常现在是
azure.core.exceptions.HttpResponseError
(《CloudError》已被删除)。 -
大多数操作 kwarg 已更改。以下是一些最明显的更改
raw
已删除。等效功能可以通过使用cls
(一个将访问内部 HTTP 响应的回调)找到,适用于高级用户- 有关完整选项集,请参阅 azure-core 请求文档中接受的参数
一般新功能
- 支持使用
typing
的类型注解。SDKs 已准备好使用 mypy。 - 该客户端现在对异步支持稳定且正式。检查您的包中的
aio
命名空间以找到异步客户端。 - 该客户端现在原生支持 OpenCensus 或 OpenTelemetry 等跟踪库。请参阅此 跟踪快速入门 以获取概述。
2.2.0 (2020-05-29)
功能
- 添加了操作 MediaservicesOperations.list_edge_policies
2.1.0 (2019-12-31)
功能
- Model VideoAnalyzerPreset 添加了新参数 experimental_options
- Model JobOutputAsset 添加了新参数 start_time
- 模型 JobOutputAsset 添加了新的参数 end_time
- 模型 Job 添加了新的参数 start_time
- 模型 Job 添加了新的参数 end_time
- 模型 AudioAnalyzerPreset 添加了新的参数 experimental_options
- 模型 ContentKeyPolicyFairPlayConfiguration 添加了新的参数 offline_rental_configuration
- 模型 FaceDetectorPreset 添加了新的参数 experimental_options
- 模型 JobOutput 添加了新的参数 start_time
- 模型 JobOutput 添加了新的参数 end_time
2.0.0 (2019-12-04)
功能
- 模型 JobInputClip 添加了新的参数 start
- 模型 JobInputClip 添加了新的参数 end
- 模型 JobInputAsset 添加了新的参数 start
- 模型 JobInputAsset 添加了新的参数 end
- 模型 JobInputHttp 添加了新的参数 start
- 模型 JobInputHttp 添加了新的参数 end
通用 breaking changes
本版本使用新一代代码生成器,可能因某些导入而引入 breaking changes。总结来说,一些模块的可见性/可导入性不正确,并已重命名。这解决了最初不应使用的类引起的一些问题。无法从 azure.mgmt.media.azure_media_services 中导入 AzureMediaServices(从 azure.mgmt.media 的导入方式与之前相同)AzureMediaServicesConfiguration 的导入已从 azure.mgmt.media.azure_media_services 移动到 azure.mgmt.media。无法使用 azure.mgmt.media.models.my_class 从 "models" 子模块导入 MyClass 模型(从 azure.mgmt.media.models 的导入方式与之前相同)无法使用 azure.mgmt.media.operations.my_class_operations 从操作子模块导入 MyClassOperations 操作类(从 azure.mgmt.media.operations 的导入方式与之前相同)最后但同样重要的是,HTTP 连接池现在默认启用。您应始终使用客户端作为上下文管理器,或调用 close(),或每个进程使用不超过一个客户端。
1.1.1 (2018-03-26)
功能
- 模型 StreamingLocator 添加了新的参数 filters
Bugfixes
- 模型 JpgImage 的参数 start 现在是必需的
- 模型 Mp4Format 的参数 filename_pattern 现在是必需的
- 模型 Image 的参数 start 现在是必需的
- 模型 AudioOverlay 的参数 input_label 现在是必需的
- 模型 Overlay 的参数 input_label 现在是必需的
- 模型 PngFormat 的参数 filename_pattern 现在是必需的
- 模型 H264Layer 的参数 bitrate 现在是必需的
- 模型 PngImage 的参数 start 现在是必需的
- 模型 VideoLayer 的参数 bitrate 现在是必需的
- 模型 StandardEncoderPreset 的参数 formats 现在是必需的
- 模型 StandardEncoderPreset 的参数 codecs 现在是必需的
- 模型 MultiBitrateFormat 的参数 filename_pattern 现在是必需的
- 模型 TransportStreamFormat 的参数 filename_pattern 现在是必需的
- 模型 Format 的参数 filename_pattern 现在是必需的
- 模型 ImageFormat 的参数 filename_pattern 现在是必需的
- 模型 JpgFormat 的参数 filename_pattern 现在是必需的
- 模型 VideoOverlay 的参数 input_label 现在是必需的
- 模型 OutputFile 的参数 labels 现在是必需的
1.1.0 (2018-01-02)
Bugfixes
- 操作 JobsOperations.list 包含正确的可选参数列表
- 操作 TransformsOperations.list 包含正确的可选参数列表
- 操作 TransformsOperations.list 包含正确的可选参数列表
- 操作 JobsOperations.list 包含正确的可选参数列表
1.0.1 (2018-10-16)
Bugfix
- 修复了 1.0.0 中的 sdist 损坏。没有代码更改。
1.0.0 (2018-10-03)
功能
- 模型 JobOutput 添加了新的参数 label
- 模型 StreamingLocatorContentKey 添加了新的参数 label_reference_in_streaming_policy
- 模型 Operation 添加了新的参数 origin
- 模型 Operation 添加了新的参数 properties
- 模型 VideoAnalyzerPreset 添加了新的参数 insights_to_extract
- 模型 LiveEventInput 添加了新的参数 access_control
- 模型 JobOutputAsset 添加了新的参数 label
- 添加了 AssetsOperations.list_streaming_locators 操作
- 添加了 JobsOperations.update 操作
- 添加了 AssetFiltersOperations 操作组
- 添加了 AccountFiltersOperations 操作组
重大更改
- 模型 StreamingEndpoint 的参数 scale_units 现在是必需的
- 模型 StreamingLocatorContentKey 已不再具有参数标签
- 模型 VideoAnalyzerPreset 已不再具有参数 audio_insights_only
- 模型 JobInput 已不再具有参数标签
- 模型 JobInputs 已不再具有参数标签
API 版本端点现在是 2018-07-01
注意
- 在 Python 3(基于 PEP420 的命名空间包)上不再安装 azure-mgmt-nspkg
1.0.0rc2(2018-07-19)
功能
- 模型 LiveEventPreview 有一个新参数 alternative_media_id
- 模型 StreamingLocator 有一个新参数 alternative_media_id
- 模型 EnvelopeEncryption 有一个新参数 custom_key_acquisition_url_template
- 模型 Job 有一个新参数 correlation_data
重大更改
- 模型 EnvelopeEncryption 已不再具有参数 custom_license_acquisition_url_template
API 版本端点现在是 2018-06-01-preview
1.0.0rc1(2018-04-23)
免责声明
这是对包的完全重写和全新的 RestAPI,完全不可兼容。
API 版本端点现在是 2018-03-30-preview
0.2.0 (2017-09-14)
错误修复
- 修复了与 check_name_availability 相关的反序列化问题
功能
- 添加了 operations.list 操作
重大更改
- 如果输入字符串长度超过 24 个字符,操作将抛出 ValidationError(不是 CloudError)
- 一些关键字参数已重命名为 "parameters"
0.1.2 (2016-06-27)
此轮包使用 azure wheel 扩展构建
0.1.1 (2016-12-12)
- 最佳参数检查(您可能经历异常从 CloudError 更改为 TypeError)
- 删除账户操作修复(随机异常)
- 创建账户操作修复(随机异常)
0.1.0 (2016-11-07)
- 初始预览版本
项目详情
下载文件
下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关 安装包 的更多信息。