iv-org / invidious

Invidious is an alternative front-end to YouTube
https://invidious.io
GNU Affero General Public License v3.0
16.02k stars 1.76k forks source link

av1 is supported on invidious but not allowed for user to chose. #2995

Closed rezad1393 closed 2 years ago

rezad1393 commented 2 years ago

open this page https://yewtu.be/watch?v=SSVbO8ZoTDI play go to setting and set the quality as dash. go to video and play it and set resolution at 20160 (4k) or 1440.

this causes the video to be played with a av1 codec as youtube doesn't support higher than 1080p with h264 and also this specific video was checked by jdownloader and I saw that it only has vp9 and av1 at 4k.

but I remember reading here that invidious project couldn't enable codec set (user selection for h264,vp9 and av1) because the player project only supported h264?

am I missing something? can video coded be set just like resolution can be set for dash already?

this will help with bandwidth for user and proxy instances.

unixfox commented 2 years ago

vp9 seems to only works with the latest version of videojs: https://github.com/iv-org/invidious/issues/2848 and we are unable to make it work with invidious.

videojs, the player used by invidious, support a lot of codecs: https://videojs.com/html5-video-support/ and videojs will use av1 instead of h264 if your browser support it. If we wanted to force a video codec, we would have to omit the video codecs from the "playlist" of codecs offered to videojs.

rezad1393 commented 2 years ago

vp9 seems to only works with the latest version of videojs: #2848 and we are unable to make it work with invidious.

videojs, the player used by invidious, support a lot of codecs: https://videojs.com/html5-video-support/ and videojs will use av1 instead of h264 if your browser support it. If we wanted to force a video codec, we would have to omit the video codecs from the "playlist" of codecs offered to videojs.

I dont understand. are you saying that the videojs supported the av1 before vp9? and I recently find our quite by change that invidious can play av1 because whenever I asked I got told that it was on videojs part and unsupported.

also if you are a firefox user, is there anyway to see a stat (like the youtube nerd stat) for video being played? maybe coded and resolution? not just for invidious but for any html5 video?

unixfox commented 2 years ago

No idea if it supported before or after, I'm just saying that there is a way to make vp9 working on invidious but it requires using the latest videojs version.

Invidious has been able to play av1 videos for a long time, when you are loading the video in 4K you are using av1 codec. This can be proved by the fact that invidious use the representation ID number 401 for videoplayback URL and this what the dash manifest link to for 401:

<Representation id="401" codecs="av01.0.12M.08" width="3840" height="2160" startWithSAP="1" maxPlayoutRate="1" bandwidth="9224108" frameRate="24">
<BaseURL>/videoplayback?expire=1648588523&amp;ei=iyJDYoO1JMKZ1gKMuYL4Dw&amp;ip=143.47.187.250&amp;id=o-AEwCOSyW_dF6dCB_wAFhQKVFx0f4dkkEVhNUuDqBVj0E&amp;itag=401&amp;source=youtube&amp;requiressl=yes&amp;mh=d7&amp;mm=31%2C26&amp;mn=sn-5hne6ns6%2Csn-25ge7nse&amp;ms=au%2Conr&amp;mv=m&amp;mvi=5&amp;pl=26&amp;initcwndbps=765000&amp;vprv=1&amp;mime=video%2Fmp4&amp;gir=yes&amp;clen=85564777&amp;dur=134.759&amp;lmt=1634862481626660&amp;mt=1648566550&amp;fvip=5&amp;keepalive=yes&amp;fexp=24001373%2C24007246&amp;c=ANDROID&amp;txp=5532434&amp;sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&amp;sig=AOq0QJ8wRQIgVYYLhvDzCocJZVU90VStyHF164zHWnvMDZaREQvA6IwCIQDUzbcXoGW9bF8ODoVaZRrUY0KLC9tlLCG3zJqOJQ_H8w%3D%3D&amp;lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&amp;lsig=AG3C_xAwRAIgTx-q_PdYHYHSiiehU9kwiQQaeSJYjZqduV15Rc8qGOkCIDaUq2R3OJRhRR_8NMRmt-X6XEQ18svXU5HkioGiuxF_&amp;host=rr5---sn-5hne6ns6.googlevideo.com</BaseURL>
<SegmentBase indexRange="701-1044">
<Initialization range="0-700"/>
</SegmentBase>
</Representation>

The codec h264 is mostly only used for non-dash, when selecting hd720 in the quality preferences.

About a way to see the codec used, I think this is only possible under Chrome/Chromium.

rezad1393 commented 2 years ago

if I am not wrong I used 480 dash for a long time because 720p dash would be h264 and too big for me. maybe those videos didnt support av1? so maybe I am wrong.

where I can track the vp9 support in invidious, because most videos support vp9. also do you know of anyway to get video stat for video being playing in firefox? something like nerdstart in youtube. or even just coded and resolution?

unixfox commented 2 years ago

Nowadays, there is hardly any video offered with the h264 codec when using dash. Only very old videos will have it. Youtube will always give videos with only av1 and vp9 codecs, even in 480p dash. Not true, please see https://github.com/iv-org/invidious/issues/2995#issuecomment-1082039586

where I can track the vp9 support in invidious, because most videos support vp9.

Here: https://github.com/iv-org/invidious/issues/2848

also do you know of anyway to get video stat for video being playing in firefox? something like nerdstart in youtube. or even just coded and resolution?

That doesn't exist, unfortunately.

unixfox commented 2 years ago

Just wanted to clarify that youtube seems to still support h264 in dash but we don't offer this codec to videojs at this time. So in dash with invidious you will never be able to load videos in h264 codec, we can add it though if you wanted to have it.

h264 with dash is only offered by youtube for 1080p and lower.

rezad1393 commented 2 years ago

Just wanted to clarify that youtube seems to still support h264 in dash but we don't offer this codec to videojs at this time. So in dash with invidious you will never be able to load videos in h264 codec, we can add it though if you wanted to have it.

h264 is only offered by youtube for 1080p and lower.

yes I know about that but I never tested 4k to see what invidious does when I thought it would not play av1 and vp9. but I think there was a time ( in the last two years actually) that invidous would play h264-480p in dash for me. as I mentioned here: https://github.com/iv-org/invidious/issues/34#issuecomment-683322920

so this part I am sure is not correct "So in dash with invidious you will never be able to load videos in h264 codec," because I remember that video that I linked in that issue , I could see with my not-20-20 eye the quality difference (basically curves not being smooth) of invidious and youtube because youtube would play at vp9 and av1. (same resolution)] but because firefox doesn't tell me about the video stat I cant be 100% sure.

unixfox commented 2 years ago

Just wanted to clarify that youtube seems to still support h264 in dash but we don't offer this codec to videojs at this time. So in dash with invidious you will never be able to load videos in h264 codec, we can add it though if you wanted to have it. h264 is only offered by youtube for 1080p and lower.

yes I know about that but I never tested 4k to see what invidious does when I thought it would not play av1 and vp9. but I think there was a time ( in the last two years actually) that invidous would play h264-480p in dash for me. as I mentioned here: #34 (comment)

Almost two years has passed, a lot has changed at youtube servers and invidious. This is probably not like this anymore.

I can assure you that for the recent videos, invidious doesn't offer videos with h264 codec to videojs. You can see it yourself on this manifest file: https://test.invidious.io/api/manifest/dash/id/SSVbO8ZoTDI?local=true&unique_res=1

rezad1393 commented 2 years ago

if that is the case then videos that dont have av1 yet (many videos are like that because they are too new) and as you say videojs doesnt support vp9 at invidious then how invidious plays them? no av1 no vp9 and no h264

unixfox commented 2 years ago

I don't think you really understood what I meant, for recent videos videojs in invidious will use av1. And for very old videos, maybe h264, but I'm not entirely sure because for the video that you linked in https://github.com/iv-org/invidious/issues/34#issuecomment-683322920, invidious offer to videojs only av1 and vp9 so only av1 will be used.

rezad1393 commented 2 years ago

nm. this is getting lost in dialog. so I am happy that now I can set at 720 and get av1 and vp9 soon for videos that dont have av1.