1
votes

I am using Azure Media Services and Azure Functions to build a VOD element for a website. Basically, when the source video is uploaded a blob trigger starts off a DurableOrchestration to create an asset and encode the video.

The uploaded videos are all 16:9 aspect ratio, which is all good.

There is now a requirement to upload 1:1 aspect ratio videos. Azure docs say that you shouldn't mix aspect ratios in your encoder presets, so I would need to create a separate encoding preset for 1:1 aspect videos and then use either one depending on the source aspect ratio.

The problem I am have is how to detect the aspect ratio (or even width and height) of the uploaded video?

If I run .FetchAttributes() on the source blob, the metadata is empty and there isn't any width or height properties. The docs say that I could examine the metadata xml of the input asset. But I can only do that once it has been encoded because that file is part of the output asset.

Is there any way to detect these properties once the source file hits blob storage, or is this just the wrong approach?

1

1 Answers

0
votes

Please share the link to the doc - it should be edited to clarify that aspect ratios should not be mixed across different layers in a single encoding preset that produces a multiple bitrate/adaptive streaming Asset. That is, you should not produce one layer at 1920x1080 and one at 720x720.

However, the encoder does support scenarios where some input videos are 16:9 and others are 1:1. Have you tried sending the 1:1 videos through, and checked if the output is what you expect?

If you need to modify the behavior to get a different output, please contact us via [email protected] with the preset you are using. Having sample content would help, too.