Videos have metadata as part of the original file that sets the display aspect ratio (DAR) and stream aspect ratio (SAR). A common explanation for aspect ratio issues is due to different DAR and SAR values.
When delivering videos, Cloudinary uses the DAR. However, when viewing videos in the Media Library, Cloudinary uses the original size which might have a different aspect ratio.
When applying transformations to a video (such as resizing it), Cloudinary discards the metadata from the original file, so the derived/transformed video is created based on the SAR, which can give you an unexpected output ratio.
You can resolve this by using the keep_dar
flag (fl_keep_dar
in URLs) in the transformation, which forces the aspect ratio to be based on the DAR in the metadata and not the (SAR) aspect ratio of the actual stream. More information on this flag can be found here.
Comments
1 comment
I'm surprised the aspect ratio isn't always preserved by default. Either way, adding this flag to my transforms solved our problem where aspect ratio wasn't preserved
Please sign in to leave a comment.