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
Build a Python utility that manages manifest filters for Azure Media Services streaming assets. Filters allow you to customize playback by controlling which tracks and bitrates are available to viewers without re-encoding content.
The utility should manage two types of filters:
Account-level filters: Apply globally to all assets in a Media Services account Asset-specific filters: Apply only to a particular asset
Implement the following operations:
Support the following filter properties:
@generates
from typing import Optional, List, Dict, Any
from azure.mgmt.media import AzureMediaServices
from azure.mgmt.media.models import AccountFilter, AssetFilter
class FilterManager:
"""Manages manifest filters for Azure Media Services."""
def __init__(self, client: AzureMediaServices, resource_group: str, account_name: str):
"""
Initialize the filter manager.
Args:
client: Azure Media Services client instance
resource_group: Azure resource group name
account_name: Media Services account name
"""
pass
def create_account_filter(
self,
filter_name: str,
bitrate_min: Optional[int] = None,
bitrate_max: Optional[int] = None,
track_type: Optional[str] = None,
presentation_time_start: Optional[int] = None,
presentation_time_duration: Optional[int] = None,
first_quality_bitrate: Optional[int] = None
) -> AccountFilter:
"""
Create an account-level filter.
Args:
filter_name: Name for the filter
bitrate_min: Minimum bitrate in bps (optional)
bitrate_max: Maximum bitrate in bps (optional)
track_type: Track type filter - "Audio", "Video", or "Text" (optional)
presentation_time_start: Start time for DVR window in ticks (optional)
presentation_time_duration: Duration for DVR window in ticks (optional)
first_quality_bitrate: First quality bitrate threshold in bps (optional)
Returns:
The created AccountFilter object
"""
pass
def create_asset_filter(
self,
asset_name: str,
filter_name: str,
bitrate_min: Optional[int] = None,
bitrate_max: Optional[int] = None,
track_type: Optional[str] = None,
presentation_time_start: Optional[int] = None,
presentation_time_duration: Optional[int] = None,
first_quality_bitrate: Optional[int] = None
) -> AssetFilter:
"""
Create an asset-specific filter.
Args:
asset_name: Name of the asset to create filter for
filter_name: Name for the filter
bitrate_min: Minimum bitrate in bps (optional)
bitrate_max: Maximum bitrate in bps (optional)
track_type: Track type filter - "Audio", "Video", or "Text" (optional)
presentation_time_start: Start time for DVR window in ticks (optional)
presentation_time_duration: Duration for DVR window in ticks (optional)
first_quality_bitrate: First quality bitrate threshold in bps (optional)
Returns:
The created AssetFilter object
"""
pass
def list_account_filters(self) -> List[AccountFilter]:
"""
List all account-level filters.
Returns:
List of AccountFilter objects
"""
pass
def get_account_filter(self, filter_name: str) -> AccountFilter:
"""
Get a specific account filter by name.
Args:
filter_name: Name of the filter to retrieve
Returns:
The AccountFilter object
"""
pass
def delete_account_filter(self, filter_name: str) -> None:
"""
Delete an account-level filter.
Args:
filter_name: Name of the filter to delete
"""
passProvides Azure Media Services management capabilities including filter operations.
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