How to set a separate key for each video track

Jason Lee 21 Reputation points
2022-11-14T03:36:25.153+00:00

I don't know how to set a separate key for each track in the Azure Media Services .Net(C#) SDK.
I know I need to use KeyToTrackMappings in StreamingPolicyContentKeys, but TrackSelection's TrackPropertyCondition only has a condition to compare with FourCC.
But I want to compare with the height of the resolution of the track.
On the other hand, the FilterTrackPropertyType used in AssetFilter has a variety of options, but why does TrackPropertyType not support these options?

Is there anyone who can help me?

Azure Media Services
Azure Media Services
A group of Azure services that includes encoding, format conversion, on-demand streaming, content protection, and live streaming services.
314 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,642 questions
0 comments No comments
{count} votes

Accepted answer
  1. sanjid 166 Reputation points Microsoft Employee
    2022-11-14T20:14:39.6+00:00

    Hi Jason,

    Our current API does not allow setting different keys for video tracks based on track resolution. The FourCC filter gives you some limited flexibility - e.g., you can setup different keys for audio and video, or have audio streamed in clear.

    If you want to secure your high-resolution content with a different key, there are a couple of potential workarounds that may work depending on your scenario -

    1) Create two assets for the same content - one asset has the HD tracks and the other one has the SD tracks (or however you want to break it up).
    2) Create two locators for the same asset. You can use the filter property on the StreamingLocator to enable server-side filtering of the tracks that are available for that locator. The filter property references your asset or account filters where you have the option to filter by bitrate, language etc.

    Note that you cannot have adaptive bitrate streaming across all tracks if you take this approach since the tracks are split either across assets or streamingLocators.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful