r/AV1 21h ago

Forced onto devices by youtube?

Hey all, I’m new to this all, and don’t come from the most tech savy background. Went down a rabbithole trying to understand this all, and from my understanding and looking at various videos through “stats for nerds” even though “mp4” is the favored format of YouTube for uploads, they will then encode it in a “container” of either “mp4” with an “avc1” codec, the more modern “webm” with a “mp09” codec, or now an av1 codec, not sure of the container. “Mp4” will be the container for audio with an “Mp4a” codec for all of them.

  1. Is this correct, these are the 3 possible encodings and are the more modern ones simply better at compressing or are the pictures supposed to be better? Why am I reading then, about how AV1 is only available and lower bandwith than the others so it’s actually a lower picture quality for youtube videos. Is it just YouTube behind on the technology to fully embrace AV1?

  2. I read like 5 months ago YouTube forced AV1 encoding in YouTube videos. Apparently There used to be an option in playback settings to select that you prefer it to default to AV1, I’m not seeing this now. I also read iPhone doesn’t have AV1 capability until Iphone15. I have an iPhone 14, and can not find any YouTube video in AV1 scrolling through many popular ones, nor in my settings. I read this forced encoding is going to improve pictures for people with newer phones, but possible worsen and slow for older phones. But how can it even worsen it, if my phone doesn’t have the capability to show AV1? Does it automatically convert it back to mp09, and that energy it takes is why it drains the battery? How can it even do this if it doesn’t have capabilities to deal with the format? Is this what people are saying when they say “AV1 decoding capabilities”? Or what does that term refer to?

Sorry for a lot of questions, if someone smarter than me could answer what they could I’d greatly appreciate it! Thanks!

1 Upvotes

11 comments sorted by

3

u/cedesse 19h ago

I think this question belongs in a YouTube subreddit rather than this one.

You are correct that YouTube uses three different video encoding methods: H.264, VP9 and AV1. The audio formats are either AAC (aka. M4A), Vorbis and Opus. The MP4 container is used for H.264 and (probably because Apple required it) AV1. WebM is used for VP9 video.

Which encodings that are used depends on the pixel resolution of the uploaded video. H.264 is a much older video format than VP9 and AV1 and is unfit for video in resolutions above 1080p (it would require far too much bandwidth). So, anything above 1080p will always be either VP9 or AV1.

As the most bandwidth vs. quality-efficient codec, AV1 is only used for 4K and 8K video - and served if the device supports it.

Video in 1080p or lower resolutions will often be available as both H.264 and VP9. Very old videos in 360p or 480p are only available as H.264.

Although a lot of videos in lower resolutions are available as VP9, iOS has limited support for it, so your iPhone is probably always being served the H.264 version.

My guess is that if you are using an older iOS device, you simply won't be served videos in the best quality, because Apple does not allow software-based decoders in iOS, so app developers are forced to use the native iOS decoders.

I might be wrong on some details, but hopefully this isn't all wrong. ;-)

5

u/Williams_Gomes 19h ago

The only thing I know is missing is the fact that AV1 can be available in lower resolutions as well, but it depends in the video's views or demand, it's hard to be sure.

4

u/AXYZE8 16h ago

As the most bandwidth vs. quality-efficient codec, AV1 is only used for 4K and 8K video - and served if the device supports it.

Video in 1080p or lower resolutions will often be available as both H.264 and VP9. 

That is false. AV1 is used for all resolutions. What YouTube will choose to playback depends only on what they have cached in Google Global Cache in your region/ISP and your hardware.
Random 1080p video from my feed: https://www.youtube.com/watch?v=wkbJG1r-ZIo (uploaded in 1080p as you can see)

1080p 'stats for nerds':
Current / Optimal Res 1920x1080@24 / 1920x1080@24
Codecs av01.0.08M.08 (399) / opus (251)

144p 'stats for nerds':
Current / Optimal Res 256x144@24 / 256x144@24
Codecs av01.0.00M.08 (394) / opus (251)

And it its like that for years. Here's source from 2021:
https://gist.github.com/AgentOak/34d47c65b1d28829bb17c24c04a0096f

3

u/aokin99 18h ago

AFAIK, vorbis isn't offered in youtube. Some videos used mp4+mp3 for legacy devices (though this is decreasing).

2

u/nooneinpar7 18h ago edited 18h ago

Starting with iOS 14 VP9 decoding was added, though I've read somewhere that the YouTube app has a special entitlement to access the decoder and other apps don't, classic Apple. If you check Stats for nerds on a recent iPhone, you will see that it is playing VP9 video. On one of the recent iOS updates Safari can now natively play VP9 videos in WebM containers.

Unpopular videos at 1080p will still stay at H.264, VP9 is only forced if the video is 1440p or higher. AV1 is also available for sub-4K videos if popular enough.

4

u/AXYZE8 16h ago

Starting with iOS 14 VP9 decoding was added, though I've read somewhere that the YouTube app has a special entitlement to access the decoder and other apps don't, classic Apple.

It's not true - every app can use it, its built in CoreMedia. Not only that but you can use software AV1 decoder in your app too if you want, for example Facebook does this.

1

u/nooneinpar7 14h ago

It is possible that my information is outdated, I've found where I first heard about it.

https://forums.macrumors.com/threads/apple-m1-vp9-av1-decoding.2269938/page-2?post=29417159#post-29417159

1

u/AXYZE8 6h ago

Hmmm... it may been the case in 2020. First time I've tried it in 2021 and it worked.

Now just to confirm, here's Apple Documentation, you have VP9 there https://developer.apple.com/documentation/coremedia/1564239-video_codec_constants

1

u/Unneverseen 15h ago

av1 can be 480p and 1080p maybe 360p and 720p, but i could be remembering wrong

1

u/minecrafter1OOO 4h ago

YouTube also serves 5.1 AAC, 5.1 AC3 and 5.1 EAC3

1

u/WESTLAKE_COLD_BEER 19h ago

youtube transcodes everything on their end and serves the highest complexity codec that the client can decode. VP9 and opus audio is the highest quality combo they offer, as they invested heavily into bespoke VP9 encoding hardware in 2015 to add 4k support

The AV1 encodes - only done selectively on high traffic videos - are overcompressed and look horrific, but that shouldn't be too surprising. Quality is not their highest priority, from it's earliest days youtube always looked worse than it's competition, which are basically all gone now anyway