Alexus
Alexus

Reputation: 952

How to Add Metadata to assets in Azure Media Services?

I am using Azure Media Services and uploading, encoding and streaming videos. Question is, is there a way to attach video titles, descriptions and tags somewhere in Azure Media Services API?

Additional details: When I process an asset, a new container in Azure Blob Storage is created, and when I click on the blob itself, it has "User Defined Fields" - aka metadata, I could use those, but I am not sure if they are exposed to Azure Media API at all and how to access them.

I searched all over MS documentation and found nothing :/

Upvotes: 2

Views: 1399

Answers (3)

The Unique Paul Smith
The Unique Paul Smith

Reputation: 686

For what it's worth, I ended up re-attaching to the Storage Blob that Azure Media Services stores to, and for each specific .mp4 asset (I only had 1 progressive streaming URI) I ended up saving my metadata to the Storage Blob, which worked well for my application.

So I had to use not only the Azure Media Service API for uploading/encoding, but also the Storage API for file based metadata manipulation.

Upvotes: 0

Alexus
Alexus

Reputation: 952

Thank you for your answer @George, I have spent a week trying and searching and tried what you suggested, but in the end, I came to a conclusion that Azure Media API is not a storage, indexer or anything bud a media processing service, and should be used as such. [Duh...]

So what I deed is introduce SQL database to my abstraction layer that kept all my data for my assets, indexing, etc. That has also helped me to speed up my system, because I no longer make calls to AMS to list my assets - I keep track of them in my database with titles, descriptions, tags, child-parent hierarchy, etc.

Upvotes: 0

George Trifonov
George Trifonov

Reputation: 1991

Currently Azure Media Services API exposing limiting set of metadata about encoded media asset. You can look in https://github.com/Azure/azure-sdk-for-media-services-extensions example of fetching metadata and how it is implemented:

// The asset encoded with the Windows Media Services Encoder. Get a reference to it from the context.
IAsset asset = null;

// Get an enumerator with the metadata for all the asset files.
IEnumerable<AssetFileMetadata> manifestAssetFile = asset.GetMetadata();

If you have requirements to have custom metadata associated with media assets and be able to search, you have to store it in external service like Azure Document DB or Azure Search. Azure Media Services exposes property IAsset.AlternateId where you can store id/key of metadata from external storage for linking purpose.

Upvotes: 1

Related Questions