invidious icon indicating copy to clipboard operation
invidious copied to clipboard

Add option for HLS quality in user preferences

Open syeopite opened this issue 2 years ago • 13 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 (though this will be fixed the videojs 8 migration)
  2. Usage of the new "HLS" quality option will completely negate the various workarounds to fetch encrypted and/or age-restricted streaming URLs

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

This pull request has been automatically marked as stale and will be closed in 30 days because it has not had recent activity and is much likely abandoned or outdated. If you think this pull request is still relevant and applicable, you just have to post a comment and it will be unmarked.

github-actions[bot] avatar May 19 '24 12:05 github-actions[bot]

It seems like #4439 fixes the issues with enabling the quality selector on HLS videos! Livestreams are still not supported however.

syeopite avatar Jun 24 '24 19:06 syeopite