ampproject / amphtml

The AMP web component framework.
https://amp.dev
Apache License 2.0
14.89k stars 3.89k forks source link

The video quality of cached videos always starts with bitrate 720 or 400 instead of 2000. #39618

Open den-jones opened 11 months ago

den-jones commented 11 months ago

Description

When I create a Web Story that contains a video on each page of the story and I enable Video Cache in the settings of the Web Story plugin, the video on the first page is always shown in bad quality (data-bitrate=”720″) the first times I look at the Web Story.

The cached videos on the next pages are always shown in the better quality. (data-bitrate=”2000″)

It only shows the best quality (data-bitrate=”2000″) on the cached video on the first page when you refresh the first page a couple of times.

My questions:

  1. Can we add a tag or something else to the source code that will ensure the cached video is always loaded in data-bitrate=”2000″, even if the internet connection isn’t good?
  2. Can we also get a cached video in a better quality than 2000kb/s because we often get remarks that the quality of the video is not as good as the original video? We generally export our videos into 6000kb/s. Thank you in advance for letting me know how we can solve this video quality issue.

Reproduction Steps

Here is an example of a Web Story that contains videos on each page to make it easier for you to test: https://liesbethdiels.be/web-stories/video-quality/

When I inspect the html of the page I can see that the cached video with the bitrate of 2000kb/s is not in the html code of the first page or if it is in the source code, it is the 3rd url in the source (the video player plays the first url if I'm not mistaken). Only when you refresh the page a couple of times, the url with the data-bitrate=”2000″ appears or becomes the first url.

Relevant Logs

No response

Browser(s) Affected

No response

OS(s) Affected

No response

Device(s) Affected

No response

AMP Version Affected

No response

erwinmombay commented 11 months ago

@ychsieh please triage

newmuis commented 11 months ago

There's a very real tradeoff between quality and buffering that is exacerbated on the earlier pages of the story (especially the first page). When the use first loads a story, the videos have not yet downloaded enough to play back, and so the highest priority thing is to download the bytes of the video as quickly as possible. Having higher quality video obviously makes this more costly to download.

We should tread carefully here, especially given the data on (a) higher quality leading to rebuffers, and (b) rebuffers leading to abandonment.

erwinmombay commented 11 months ago

cc @banaag please chime in if you have any addtl info