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-9/

Media Intelligence Pipeline

Build a media analysis pipeline that processes video and audio files to extract insights including transcription, scene detection, and face detection.

Background

Your organization needs to analyze media content uploaded by users. The system should:

  1. Accept media files (video or audio)
  2. Extract insights from the content
  3. Store results for later retrieval
  4. Support different analysis modes based on content type

Requirements

Create a Python application that implements the following functionality:

1. Create Audio Analysis Transform

Create a function create_audio_analysis_transform(client, resource_group, account_name, transform_name, language_code) that:

  • Creates a transform configured for audio analysis
  • Configures the transform to perform transcription with the specified language code (e.g., "en-US")
  • Configures the transform to use Standard mode for comprehensive analysis
  • Returns the created transform object

2. Create Video Analysis Transform

Create a function create_video_analysis_transform(client, resource_group, account_name, transform_name, insights_mode) that:

  • Creates a transform configured for video analysis
  • Configures the transform based on the insights_mode parameter: "VideoInsightsOnly", "AudioInsightsOnly", or "AllInsights"
  • Uses Standard Definition resolution for analysis
  • Returns the created transform object

3. Submit Analysis Job

Create a function submit_analysis_job(client, resource_group, account_name, transform_name, job_name, input_asset_name, output_asset_name) that:

  • Submits a job using the specified transform
  • Configures the job to read from the input asset and write results to the output asset
  • Returns the created job object

File Structure

Your implementation should use the following structure:

media_analysis/
├── __init__.py
├── pipeline.py         # Main implementation
└── pipeline.test.py    # Test file

Testing

Write tests in pipeline.test.py that verify:

Test 1: Audio Transform Creation @test

Test that create_audio_analysis_transform correctly creates an audio analysis transform. Verify that:

  • A transform is created with the correct name
  • The transform is configured for audio analysis
  • The language code is properly set

Test 2: Video Transform Creation @test

Test that create_video_analysis_transform correctly creates a video analysis transform. Verify that:

  • A transform is created with the correct name
  • The insights mode is properly configured
  • The function returns a transform object

Test 3: Job Submission @test

Test that submit_analysis_job successfully submits a job. Verify that:

  • A job is created with the specified name
  • The job references the correct transform, input asset, and output asset
  • The function returns a job object

Dependencies { .dependencies }

azure-mgmt-media { .dependency }

Provides Azure Media Services management capabilities for media processing and analysis.

azure-identity { .dependency }

Provides Azure authentication support.

Notes

  • Use mock clients or test fixtures for testing; do not make actual API calls
  • Handle potential errors gracefully (e.g., resource not found, job failures)
  • The package name is azure-mgmt-media and uses Python 3.9+
  • Assume proper Azure credentials are available via DefaultAzureCredential

Install with Tessl CLI

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

tile.json