CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-azure-mgmt-media

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

1.09x

Quality

Pending

Does it follow best practices?

Impact

83%

1.09x

Average score across 10 eval scenarios

Overview
Eval results
Files

task.mdevals/scenario-8/

Multi-Bitrate Video Encoding Transform

Problem Statement

You need to implement a video encoding transform configuration that processes uploaded video content into an adaptive bitrate (ABR) streaming format. The transform should create multiple quality layers suitable for adaptive streaming delivery across various network conditions and device capabilities.

Requirements

Your implementation must:

  1. Create a transform that encodes video into H.264 format with three distinct quality layers:

    • High quality layer: 1080p resolution (1920x1080), 3.5 Mbps bitrate
    • Medium quality layer: 720p resolution (1280x720), 2.0 Mbps bitrate
    • Low quality layer: 480p resolution (854x480), 1.0 Mbps bitrate
  2. Configure audio encoding with AAC codec at 128 kbps for all output layers

  3. Set the video complexity to "Balanced" to optimize encoding speed and quality

  4. Use constant frame rate (CFR) synchronization mode for consistent playback

  5. Configure the output format as MP4 with appropriate filename patterns that include the layer label

  6. The transform should accept a single video asset as input and produce a single multi-layer output asset

Implementation Details

Create a Python script encode_transform.py that implements a function:

def create_multi_bitrate_transform(transform_name: str, description: str = "Multi-bitrate encoding transform"):
    """
    Creates an encoding transform with multiple quality layers.

    Args:
        transform_name: Name for the transform
        description: Description of what the transform does

    Returns:
        A transform configuration object suitable for creating transforms
    """
    pass

The function should return a properly configured transform object (not create it in Azure - just return the configuration).

Test Cases { .test-cases }

Test Case 1: Basic Transform Structure { .test-case @test }

Input:

transform = create_multi_bitrate_transform("TestTransform")

Expected Output:

  • Transform configuration with exactly 3 H.264 video layers (1080p, 720p, 480p)
  • Transform configuration with AAC audio encoding
  • MP4 output format

Test Case 2: Layer Configuration { .test-case @test }

Input:

transform = create_multi_bitrate_transform("QualityTest")

Expected Output:

  • High quality layer with bitrate of 3500000 bps (3.5 Mbps) and resolution 1920x1080
  • Medium quality layer with bitrate of 2000000 bps (2.0 Mbps) and resolution 1280x720
  • Low quality layer with bitrate of 1000000 bps (1.0 Mbps) and resolution 854x480
  • All layers use constant frame rate synchronization

Test Case 3: Audio Configuration { .test-case @test }

Input:

transform = create_multi_bitrate_transform("AudioTest")

Expected Output:

  • AAC audio codec with 128000 bps bitrate
  • Audio configured for all output variations

Test File

Create tests in test_encode_transform.py.

Dependencies { .dependencies }

azure-mgmt-media { .dependency }

Azure Media Services management library providing video encoding and streaming capabilities.

Install with Tessl CLI

npx tessl i tessl/pypi-azure-mgmt-media

tile.json