invidious icon indicating copy to clipboard operation
invidious copied to clipboard

Add option for HLS quality in user preferences

Open syeopite opened this issue 9 months ago • 10 comments

Closes #3318 Closes #2236

If applicable, I'll like to claim the bounty for the latter issue.


This PR adds a new HLS quality option that forces the usage of the HLS manifest given by the IOS InnerTube client. This allows qualities of up to 1080p on IOS devices but it also introduces a couple problems:

  1. You cannot change the video quality
  2. Usage of the new "HLS" quality option will completely negate the various workarounds to fetch encrypted and/or age-restricted streaming URLs
  3. When trying to force HLS, we ignore the cache and make a new request as HLS manifests aren't typically included in YouTube's normal responses

syeopite avatar Sep 23 '23 20:09 syeopite

You'll also need to modify disable_proxy to accept an hls option

That should do the trick. On another note, now that there's a hls option, should the livestream parameter be merged together with it?

syeopite avatar Sep 28 '23 01:09 syeopite

Livestreams have both DASH and HLS manifests, video.js's can't handle YouTube's live stream DASH (YouTube uses self-initialising segments, which are part of the DASH spec, but heavily discouraged by the DASH interoperability guidelines, as it's a lot less efficient, sending the init data along with every segment, than doing it once), which is why Invidious only uses HLS, but external services that use Invidious's proxy, might use the live stream DASH manifests (FreeTube soon-ish).

absidue avatar Sep 28 '23 06:09 absidue

Irrc Invidious treats the livestream parameter as a hls parameter and is used only to disable hls manifests.

syeopite avatar Sep 28 '23 10:09 syeopite

Irrc Invidious treats the livestream parameter as a hls parameter and is used only to disable hls manifests.

We consider a /videoplayback URL as a "livestream" if it contains &file=seg.ts. I don't know if that's the case for other HLS URLs tho.

SamantazFox avatar Oct 08 '23 21:10 SamantazFox

I believe it is the case for the other HLS urls. I'll keep the livestream parameter for now though since it may be too much of a breaking-change to remove that configuration option.

syeopite avatar Oct 21 '23 19:10 syeopite

@syeopite is this PR intended to only work on iOS devices? When setting quality to HLS I'm only able to play back videos on an iPhone. Safari and all other browses on macOS just try to load indefinitely.

stonerl avatar Nov 20 '23 16:11 stonerl

That's weird... Maybe it's related to #4199? It definitely shouldn't be limited to just IOS.

syeopite avatar Nov 21 '23 02:11 syeopite

It could be something to do with the HLS streams returned by the iOS client, using MP4 files that contain vp9 video, which is possibly something that video.js doesn't support (For DASH and HLS, the player javascript has to extract the "raw" audio and video from the streams, so it's transmuxer needs to have support for the containers and codecs you want to use)?

On iOS, HLS manifests are handled by the browser itself, so that's probably why it works fine there.

absidue avatar Nov 21 '23 05:11 absidue