Microsoft Azure Media Services Client Library for Python - A management library for Azure Media Services that provides programmatic access to media processing and streaming capabilities in the cloud.
83
Quality
Pending
Does it follow best practices?
Impact
83%
1.09xAverage score across 10 eval scenarios
A utility that publishes encoded video assets for streaming delivery to end-users using cloud media services.
You need to implement a video streaming publisher that takes encoded video assets and makes them available for streaming to viewers. The system should support multiple streaming protocols, manage streaming infrastructure, and generate playback URLs.
The system must be able to publish video assets for streaming delivery by creating appropriate publishing configurations. Assets should be made available through a unique identifier.
The system must manage streaming infrastructure including:
The system must generate playback URLs for published assets. URLs should support multiple streaming protocols including:
When publishing assets, the system should support different streaming policies that control how content is packaged and delivered. At minimum, support for a default clear streaming policy should be included.
@generates
class StreamingPublisher:
"""Manages video asset publishing and streaming delivery."""
def __init__(self, client, resource_group: str, account_name: str):
"""
Initialize the publisher.
Args:
client: Azure Media Services client
resource_group: Azure resource group name
account_name: Media Services account name
"""
pass
def publish_asset(self, asset_name: str, locator_name: str, streaming_policy: str = "Predefined_ClearStreamingOnly") -> dict:
"""
Publish an asset for streaming by creating a streaming locator.
Args:
asset_name: Name of the asset to publish
locator_name: Unique name for the streaming locator
streaming_policy: Name of the streaming policy to use
Returns:
Dictionary containing locator information
"""
pass
def start_streaming_endpoint(self, endpoint_name: str) -> None:
"""
Start a streaming endpoint to enable content delivery.
Args:
endpoint_name: Name of the streaming endpoint to start
"""
pass
def stop_streaming_endpoint(self, endpoint_name: str) -> None:
"""
Stop a streaming endpoint.
Args:
endpoint_name: Name of the streaming endpoint to stop
"""
pass
def scale_streaming_endpoint(self, endpoint_name: str, scale_units: int) -> None:
"""
Scale a streaming endpoint to handle more concurrent viewers.
Args:
endpoint_name: Name of the streaming endpoint
scale_units: Number of scale units (0 for standard, >0 for premium)
"""
pass
def get_streaming_urls(self, locator_name: str, endpoint_name: str) -> dict:
"""
Generate streaming URLs for a published asset.
Args:
locator_name: Name of the streaming locator
endpoint_name: Name of the streaming endpoint
Returns:
Dictionary with protocol names as keys and URLs as values
Example: {"HLS": "https://...", "DASH": "https://...", "SmoothStreaming": "https://..."}
"""
pass
def get_endpoint_hostname(self, endpoint_name: str) -> str:
"""
Get the hostname of a streaming endpoint.
Args:
endpoint_name: Name of the streaming endpoint
Returns:
Hostname string
"""
passProvides Azure Media Services management capabilities for publishing and streaming video content.
Install with Tessl CLI
npx tessl i tessl/pypi-azure-mgmt-mediadocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10