Need aspect ratio or height and width for video during video upload in eDAM | Community
Skip to main content
New Participant
September 1, 2016
Solved

Need aspect ratio or height and width for video during video upload in eDAM

  • September 1, 2016
  • 3 replies
  • 2465 views

Hi All,

When we upload image in eDAM, Metadata Processor(com.day.cq.dam.core.process.MetadataProcessorProcess - CQ5 out of box workflow process) is extracting metadata details(image length and width.. etc) for the image.

Is it possible to get aspect ratio or height or width for the video when we upload video in eDAM ?

Thanks

Sankar

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by kautuk_sahni

Hi 

I am not sure if this would help you.

But you can try, the AssetDetails class to get the details of a particular DAM Asset.

For e.g.,

Resource res = resourceResolver.getResource("<<path to resource>>"); 
AssetDetails assetDetails = new AssetDetails(res);
assetDetails.getHeight();
assetDetails.getWidth();

Documentation :- https://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/com/day/cq/wcm/resource/details/AssetDetails.html

I hope this will help you.

Thanks and Regards

Kautuk Sahni

3 replies

kautuk_sahni
Employee
September 12, 2016

Adding more reference:-

1. https://github.com/AdobeAtAdobe/aem-spa-example/blob/master/modules/application/jcr_root/apps/aaa/teamsite/components/video/VideoComponent.java

// This is code example of Video component. 

            public Long getAvsRenditionWidth(Rendition rendition){
                    ValueMap renditionValueMap = rendition.getChild("jcr:content").getChild("metadata").getValueMap();
                    return renditionValueMap.get("width",Long.class);
               }

2. https://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/com/day/cq/dam/commons/util/UIHelper.html

//This class provides various utility methods pertaining to DAM required in presentation/user interface.

I hope this will also help you.

~kautuk

Kautuk Sahni
smacdonald2008
New Participant
September 9, 2016

As Kautuk suggest - use the API and write a custom step and add that step to the given workflow. 

kautuk_sahni
kautuk_sahniAccepted solution
Employee
September 9, 2016

Hi 

I am not sure if this would help you.

But you can try, the AssetDetails class to get the details of a particular DAM Asset.

For e.g.,

Resource res = resourceResolver.getResource("<<path to resource>>"); 
AssetDetails assetDetails = new AssetDetails(res);
assetDetails.getHeight();
assetDetails.getWidth();

Documentation :- https://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/com/day/cq/wcm/resource/details/AssetDetails.html

I hope this will help you.

Thanks and Regards

Kautuk Sahni

Kautuk Sahni