anddea / revanced-patches

🧩 Patches for ReVanced
https://revanced.app
GNU General Public License v3.0
566 stars 41 forks source link

feat: Disable the AV1 codec #267

Closed DanGLES3 closed 4 months ago

DanGLES3 commented 5 months ago

Application

YouTube

Feature description

Seems with the march Play System update Google might have accidentally enabled the AV1 codec on all/some devices (regardless of hardware support) thus causing significant battery drain on devices without hardware AV1 decoding, i had to workaround with root by stripping out the AV1 codec from the update

If possible could a feature be implemented to force disable the AV1 codec to workaround this issue? The affected app is Youtube and likely Youtube Music as well (haven't tested the latter)

Motivation

The use of the AV1 codec on unsupported devices causes huge strain on the CPU and thus significant battery drain, without an workaround/fix affected users will notice their devices heating up and running slower due to the overhead of decoding AV1 video

Acknowledgements

selfmusing commented 5 months ago

YouTube settings > ReVanced Extended > Miscellaneous > Change video codec setting ( you can either change it to vp9 or HDR )

Isn't this working?? πŸ‘€

Screenshot_20240405-013159_YouTube_Music

YT Music v6.46.52 still hasn't affected.

DanGLES3 commented 5 months ago

YouTube settings > ReVanced Extended > Miscellaneous > Change video codec setting ( you can either change it to vp9 or HDR )

Isn't this working?? πŸ‘€

Screenshot_20240405-013159_YouTube_Music

YT Music v6.46.52 still hasn't affected.

Not at all, at least not for me, that's why I had to resort to a root workaround

selfmusing commented 5 months ago

YouTube settings > ReVanced Extended > Miscellaneous > Change video codec setting ( you can either change it to vp9 or HDR ) Isn't this working?? πŸ‘€ Screenshot_20240405-013159_YouTube_Music YT Music v6.46.52 still hasn't affected.

Not at all, at least not for me, that's why I had to resort to a root workaround

Strange πŸ€” , I'm still getting vp9 codec tho on both YT & YT music .

You can also try installing armv7 build & then try to spoof the codec to vp9 from miscellaneous settings ( Google don't include libgav1JNI.so file in armv7 libs , which is responsible for av1 codec )

DanGLES3 commented 5 months ago

YouTube settings > ReVanced Extended > Miscellaneous > Change video codec setting ( you can either change it to vp9 or HDR ) Isn't this working?? πŸ‘€ Screenshot_20240405-013159_YouTube_Music YT Music v6.46.52 still hasn't affected.

Not at all, at least not for me, that's why I had to resort to a root workaround

Strange πŸ€” , I'm still getting vp9 codec tho on both YT & YT music .

You can also try installing armv7 build & then try to spoof the codec to vp9 from miscellaneous settings ( Google don't include libgav1JNI.so file in armv7 libs , which is responsible for av1 codec )

I've already seen 2 other users in the Revanced subreddit with this issue, seems to be the result of some A/B testing, also i'm not with my device rn to test it, but when i tried forcefully disabling/removing the libgav1JNI of Youtube, playback remained in AV1

Iirc that's because Youtube was using the built in software AV1 decoder that they push with their apex/play system updates (noticed because the swcodec process was spiking in CPU usage) if it was using Youtube's built in lib the CPU load should be solely on Youtube no? (at least that's the case when i use software decoding on VLC)

With root i worked around the issue by undeclaring the AV1 codec from the media_codecs.xml file in the media.swcodec apex library

DanGLES3 commented 5 months ago

YouTube settings > ReVanced Extended > Miscellaneous > Change video codec setting ( you can either change it to vp9 or HDR ) Isn't this working?? πŸ‘€ Screenshot_20240405-013159_YouTube_Music YT Music v6.46.52 still hasn't affected.

Not at all, at least not for me, that's why I had to resort to a root workaround

Strange πŸ€” , I'm still getting vp9 codec tho on both YT & YT music .

You can also try installing armv7 build & then try to spoof the codec to vp9 from miscellaneous settings ( Google don't include libgav1JNI.so file in armv7 libs , which is responsible for av1 codec )

Btw the issue affects browsers as well, even when watching Youtube on the browser it was still using AV1 (tho a userscript like h264ify did manage to force it back to avc)

Not sure the feasibility of this and i'm not familiar how the current codec patches work, but i believe it might be necessary to make so Youtube cannot see AV1 codec support on the system whatsoever, because only this for me made Youtube go back into VP9

Anurag69 commented 5 months ago

Yes I'm facing the same issue and it maybe partially related to HDR issue also, While the disable HDR video tag is enabled , vp9 codec is forced i am only seeing vp9 in the hdr videos and while for the other videos I'm still seeing Av01 codec being used

Anurag69 commented 5 months ago

With root i worked around the issue by undeclaring the AV1 codec from the media_codecs.xml file in the media.swcodec apex library

Do you know how to fix this for no root users?

DanGLES3 commented 5 months ago

With root i worked around the issue by undeclaring the AV1 codec from the media_codecs.xml file in the media.swcodec apex library <

Do you know how to fix this for no root users?

Unfortunately no, tried everything I could on my end before resorted to root

Even much older versions of Revanced (and even the official YouTube app) were defaulting to AV1, feel free to try it yourself tho, maybe I didn't went far back enough

Only workaround for non-root users is either accessing YouTube through a browser that supports extensions (to use H264ify) or using a third party client like Newpipe/Grayjay/Libretube

Anurag69 commented 5 months ago

Sad life of no root users πŸ˜”

DanGLES3 commented 5 months ago

Sad life of no root users πŸ˜”

But tbh it's a YouTube issue, not a Revanced one, we should be spamming this to YouTube's support as well as it's their problem, not ours

DanGLES3 commented 5 months ago

Sad life of no root users πŸ˜”

Haven't tested this myself but you can go to the desktop YouTube website, tap your account icon, settings, playback and performance and try switching to "prefer AV1 for SD", according to that option it'll switch to VP9 for high resolution content

Anurag69 commented 5 months ago

Tried it somehow fix for some videos like for Costa Rica 4k hdr Video. First it plays video in hdr mode with avc1 codec for around 15-20 sec then it switched to VP9 codec

NCLnclNCL commented 4 months ago

YouTube settings > ReVanced Extended > Miscellaneous > Change video codec setting ( you can either change it to vp9 or HDR ) Isn't this working?? πŸ‘€ Screenshot_20240405-013159_YouTube_Music YT Music v6.46.52 still hasn't affected.

Not at all, at least not for me, that's why I had to resort to a root workaround

Strange πŸ€” , I'm still getting vp9 codec tho on both YT & YT music . You can also try installing armv7 build & then try to spoof the codec to vp9 from miscellaneous settings ( Google don't include libgav1JNI.so file in armv7 libs , which is responsible for av1 codec )

I've already seen 2 other users in the Revanced subreddit with this issue, seems to be the result of some A/B testing, also i'm not with my device rn to test it, but when i tried forcefully disabling/removing the libgav1JNI of Youtube, playback remained in AV1

Iirc that's because Youtube was using the built in software AV1 decoder that they push with their apex/play system updates (noticed because the swcodec process was spiking in CPU usage) if it was using Youtube's built in lib the CPU load should be solely on Youtube no? (at least that's the case when i use software decoding on VLC)

With root i worked around the issue by undeclaring the AV1 codec from the media_codecs.xml file in the media.swcodec apex library

Can you explain more clearly what to do, and how to check the codec on youtube android, I only see it on TV and computer

DanGLES3 commented 4 months ago

YouTube settings > ReVanced Extended > Miscellaneous > Change video codec setting ( you can either change it to vp9 or HDR ) Isn't this working?? πŸ‘€ Screenshot_20240405-013159_YouTube_Music YT Music v6.46.52 still hasn't affected.

Not at all, at least not for me, that's why I had to resort to a root workaround

Strange πŸ€” , I'm still getting vp9 codec tho on both YT & YT music . You can also try installing armv7 build & then try to spoof the codec to vp9 from miscellaneous settings ( Google don't include libgav1JNI.so file in armv7 libs , which is responsible for av1 codec )

I've already seen 2 other users in the Revanced subreddit with this issue, seems to be the result of some A/B testing, also i'm not with my device rn to test it, but when i tried forcefully disabling/removing the libgav1JNI of Youtube, playback remained in AV1 Iirc that's because Youtube was using the built in software AV1 decoder that they push with their apex/play system updates (noticed because the swcodec process was spiking in CPU usage) if it was using Youtube's built in lib the CPU load should be solely on Youtube no? (at least that's the case when i use software decoding on VLC) With root i worked around the issue by undeclaring the AV1 codec from the media_codecs.xml file in the media.swcodec apex library

Can you explain more clearly what to do, and how to check the codec on youtube android, I only see it on TV and computer

To check you enable stats for nerds in the general settings, then on a video tap the gear icon and stats for nerds

As for what I did to fix with root, its a bit convoluted as it requires a root method that can mount the Apex partition (might be a Kitsune Magisk only thing, I'm not sure) I could make a module for it I suppose

selfmusing commented 4 months ago

YouTube settings > ReVanced Extended > Miscellaneous > Change video codec setting ( you can either change it to vp9 or HDR ) Isn't this working?? πŸ‘€ Screenshot_20240405-013159_YouTube_Music YT Music v6.46.52 still hasn't affected.

Not at all, at least not for me, that's why I had to resort to a root workaround

Strange πŸ€” , I'm still getting vp9 codec tho on both YT & YT music . You can also try installing armv7 build & then try to spoof the codec to vp9 from miscellaneous settings ( Google don't include libgav1JNI.so file in armv7 libs , which is responsible for av1 codec )

I've already seen 2 other users in the Revanced subreddit with this issue, seems to be the result of some A/B testing, also i'm not with my device rn to test it, but when i tried forcefully disabling/removing the libgav1JNI of Youtube, playback remained in AV1 Iirc that's because Youtube was using the built in software AV1 decoder that they push with their apex/play system updates (noticed because the swcodec process was spiking in CPU usage) if it was using Youtube's built in lib the CPU load should be solely on Youtube no? (at least that's the case when i use software decoding on VLC) With root i worked around the issue by undeclaring the AV1 codec from the media_codecs.xml file in the media.swcodec apex library

Can you explain more clearly what to do, and how to check the codec on youtube android, I only see it on TV and computer

To check you enable stats for nerds in the general settings, then on a video tap the gear icon and stats for nerds

As for what I did to fix with root, its a bit convoluted as it requires a root method that can mount the Apex partition (might be a Kitsune Magisk only thing, I'm not sure) I could make a module for it I suppose

πŸ‘€ Spoiler: In the next RVX Patch update , inotia also added a toggle to reject software AV1 codec response 🫑

NCLnclNCL commented 4 months ago

YouTube settings > ReVanced Extended > Miscellaneous > Change video codec setting ( you can either change it to vp9 or HDR ) Isn't this working?? πŸ‘€ Screenshot_20240405-013159_YouTube_Music YT Music v6.46.52 still hasn't affected.

Not at all, at least not for me, that's why I had to resort to a root workaround

Strange πŸ€” , I'm still getting vp9 codec tho on both YT & YT music . You can also try installing armv7 build & then try to spoof the codec to vp9 from miscellaneous settings ( Google don't include libgav1JNI.so file in armv7 libs , which is responsible for av1 codec )

I've already seen 2 other users in the Revanced subreddit with this issue, seems to be the result of some A/B testing, also i'm not with my device rn to test it, but when i tried forcefully disabling/removing the libgav1JNI of Youtube, playback remained in AV1 Iirc that's because Youtube was using the built in software AV1 decoder that they push with their apex/play system updates (noticed because the swcodec process was spiking in CPU usage) if it was using Youtube's built in lib the CPU load should be solely on Youtube no? (at least that's the case when i use software decoding on VLC) With root i worked around the issue by undeclaring the AV1 codec from the media_codecs.xml file in the media.swcodec apex library

Can you explain more clearly what to do, and how to check the codec on youtube android, I only see it on TV and computer

To check you enable stats for nerds in the general settings, then on a video tap the gear icon and stats for nerds

As for what I did to fix with root, its a bit convoluted as it requires a root method that can mount the Apex partition (might be a Kitsune Magisk only thing, I'm not sure) I could make a module for it I suppose

i will wait for module, I just checked, there is a small percentage of videos that are avc1, the majority are still vp9

DanGLES3 commented 4 months ago

YouTube settings > ReVanced Extended > Miscellaneous > Change video codec setting ( you can either change it to vp9 or HDR ) Isn't this working?? πŸ‘€ Screenshot_20240405-013159_YouTube_Music YT Music v6.46.52 still hasn't affected.

Not at all, at least not for me, that's why I had to resort to a root workaround

Strange πŸ€” , I'm still getting vp9 codec tho on both YT & YT music . You can also try installing armv7 build & then try to spoof the codec to vp9 from miscellaneous settings ( Google don't include libgav1JNI.so file in armv7 libs , which is responsible for av1 codec )

I've already seen 2 other users in the Revanced subreddit with this issue, seems to be the result of some A/B testing, also i'm not with my device rn to test it, but when i tried forcefully disabling/removing the libgav1JNI of Youtube, playback remained in AV1 Iirc that's because Youtube was using the built in software AV1 decoder that they push with their apex/play system updates (noticed because the swcodec process was spiking in CPU usage) if it was using Youtube's built in lib the CPU load should be solely on Youtube no? (at least that's the case when i use software decoding on VLC) With root i worked around the issue by undeclaring the AV1 codec from the media_codecs.xml file in the media.swcodec apex library

Can you explain more clearly what to do, and how to check the codec on youtube android, I only see it on TV and computer

To check you enable stats for nerds in the general settings, then on a video tap the gear icon and stats for nerds As for what I did to fix with root, its a bit convoluted as it requires a root method that can mount the Apex partition (might be a Kitsune Magisk only thing, I'm not sure) I could make a module for it I suppose

i will wait for module, I just checked, there is a small percentage of videos that are avc1, the majority are still vp9

If videos are still AVC1 and VP9 then you don't really have this issue, the issue is AV1

Francesco146 commented 4 months ago

fixed in rvx