ampproject / ampproject/amphtml

[Story] Not enough Pixel in video served from cache=google when the video is in portrait

Open
#37,853 4 comments 0 reactions 1 assignee Claimed by @gmajoulet View on GitHub
P1: High Priority Stale Type: Bug WG: stories
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

### Description

Portrait is the main media used in Story, but today video served from the cache are in **405x720px.**

When we watch a landscape video (16/9) on YouTube and select 720p we get a video of 720px height giving a resolution of 1280x720px (720x16/9=1280) giving a total of 921 600px.

However, as a Story is in portrait (9/16) it's currently giving a video of 720px height and so it's giving a resolution of 405x720px (720*9/16=405) giving a total of 291 600px, 3 times lower than a usual 720p.

Obviously it can be interesting to serve a lower resolution for lower bit rate, but currently videos served for the 2000 kbps bit rate are in 405x720px which gives the equivalent of a 16/9 480p quality which is very low.

The low quality of video with good connection is a subject that our clients talk about a lot.

I think that while transcoding it should check if the video is landscape or portrait and use 720px for the smaller dimension.

Landscape : 720px in height
Portrait : 720px in width

_PS: Maybe the label "Type: Bug" is not the good one._

### Reproduction Steps

https://perifit.my.join-stories.com/unboxing-perifit-c7pO60b/

In this story you can compare the resolution of a [video from the cache](https://rr3---sn-4gxx-25gy.googlevideo.com/videoplayback?expire=1646933963&ei=mw0qYoWgMIy6W7rQt9gG&ip=2a01:e0a:1f1:f2b0:5c76:fd42:731e:c8ec&id=dd650214859e1b3c&itag=22&source=stamp&requiressl=yes&mh=Md&mm=31&mn=sn-4gxx-25gy&ms=au&mv=m&mvi=3&nh=EAE&pl=44&susc=stamp&obr=https://perifit.my.join-stories.com&acao=yes&mime=video/mp4&vprv=1&dur=10.100&lmt=1645790655487856&mt=1646923028&txp=0011224&sparams=expire,ei,ip,id,itag,source,requiressl,susc,obr,acao,mime,vprv,dur,lmt&sig=AOq0QJ8wRgIhAKPZ08wGdUsZE9rfI2LkIZyFQ_YmClNZ8Z6vuBQ7FJJbAiEA63wAVWdCowbdLnNGFQeRWL3b6V51AVtH07lxQi9sljk=&lsparams=mh,mm,mn,ms,mv,mvi,nh,pl&lsig=AG3C_xAwRQIhAOt_pOsBdW01N5CwgTVxmj26mI4366678L6QjsfypF1aAiB8QMEO7GuprRKmX80kyOXYF1WdskNx5BodGl33aX9SvA==)
and a video from [the source mp4 file](https://perifit.my.join-stories.com/unboxing-perifit-c7pO60b/public/perifit/assets/videos/optimized/mp4/98354213155225-c49f193b-b38d-450d-a97a-28fccf4652c1-Join-Story-Unboxing-2.mp4)

### Relevant Logs

_No response_

### Browser(s) Affected

_No response_

### OS(s) Affected

_No response_

### Device(s) Affected

_No response_

### AMP Version Affected

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.