videojs / http-streaming

HLS, DASH, and future HTTP streaming protocols library for video.js
https://videojs-http-streaming.netlify.app/
Other
2.52k stars 424 forks source link

High resolution qualities of YouTube not working (Webm) #970

Closed GilgusMaximus closed 3 years ago

GilgusMaximus commented 4 years ago

Please do not delete the template, by filling out the required information we can investigate your issue more quickly.

Before opening an issue see if your problem can be resolved with the troubleshooting guide.

Description

So we over at FreeTube want to stream videos from YouTube in resolutions higher than 1080p with Video.js and MPEG-Dash files. On the one hand we have video/mp4 formats with 2k and 4k resolutions, which are not picked up by the player and the plugin (lower resolutions are). On the other hand we have video/webm formats with the same range of resolutions, from which none is picked up. Not even the low resolutions.

Sources

Whole project: https://github.com/FreeTubeApp/FreeTube Vue code that creates the player: https://github.com/FreeTubeApp/FreeTube/blob/development/src/renderer/components/ft-video-player/ft-video-player.vue The JS code related to the player, especially functions at lines 145 and 287

Results

Expected

2k, 4k and 1440p should be available as video qualities in mp4 and all qualities as well in webm format.

Error output

No webm format is available. Only mp4 formats with resolution 1080p and lower are available.

Additional Information

This was also talked about earlier over at here, but the fix does not work for us anymore: https://github.com/jfujita/videojs-http-source-selector/issues/47

videojs-http-streaming version

what version of videojs-http-streaming does this occur with? videojs-http-streaming 1.10.6

videojs version

what version of videojs does this occur with? video.js 7.6.6

Browsers

what browsers are affected? please include browser and version for each

Platforms

what platforms are affected? please include operating system and version or device and version for each

Other Plugins

are any other videojs plugins being used on the page? If so, please list them with version below. *videojs-abloop: 1.1.2

gkatsev commented 4 years ago

There are a couple of things here. We limit the rendition chosen to the size of the player by default, so, if you have a small window or a 1080p monitor even in fullscreen it won't select a playlist above 1080p. There is an option to turn it off, though: limitRenditionByPlayerDimensions. Another useful option is useDevicePixelRatio. While setting limitRenditionByPlayerDimensions will help select the higher items, we still have an issue where we don't do a good job at handling putting a lot of data into source buffers. This means that high bitrate videos don't work well, even if the resolution isn't that big as is. It is something that we plan on fixing.

Unfortunately, in VHS 1.x, we don't support webm at all, so, it doesn't get chosen. We do plan on fixing it soon. I think in VHS 2.x, we support any codec in an mp4 as long as the browser supports it (I think webm is still not supported there).

GilgusMaximus commented 4 years ago

Thank you very much. We'll try around with the version 2.x to get it working. I already suspected that such flags were in place, so I installed all the stuff on my device with 4k resolution. Unfortunately that did not solve the issue.

But now we have an idea to go forward. Again thanks :)

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

singerxt commented 2 years ago

There are a couple of things here. We limit the rendition chosen to the size of the player by default, so, if you have a small window or a 1080p monitor even in fullscreen it won't select a playlist above 1080p. There is an option to turn it off, though: limitRenditionByPlayerDimensions. Another useful option is useDevicePixelRatio. While setting limitRenditionByPlayerDimensions will help select the higher items, we still have an issue where we don't do a good job at handling putting a lot of data into source buffers. This means that high bitrate videos don't work well, even if the resolution isn't that big as is. It is something that we plan on fixing.

Unfortunately, in VHS 1.x, we don't support webm at all, so, it doesn't get chosen. We do plan on fixing it soon. I think in VHS 2.x, we support any codec in an mp4 as long as the browser supports it (I think webm is still not supported there).

Hello, I'm experiencing issues with 4k video even on powerful machines. Is the buffer issue resolved? If not could you point me to where should I start digging?

@gkatsev

ghost commented 1 year ago

Is webm supported on vhs now?