Live data from Hacker News

Netflix is now doing per-shot encoding for UHD content

netflixtechblog.com

111–120 of 200 posts

Re: Netflix is now doing per-shot encoding for UHD content

#111
post #96

Earlier quoted context omitted.

> It's really too bad that they haven't rolled this out for 1080p too Maybe they will? But it matters most for 4K performance, so that's where they started? > encoders (x264, x265, etc) already have their own rate control algorithms But they simply operate on a stream without taking future frames into account. This does a first entire pass on the film holistically to determine where keyframes should go and settings p…

> This does a first entire pass on the film holistically to determine where keyframes should go and settings per-shot. It can't be backported to codecs because they work linearly. Given that x264 already has a 2 pass mode, I don't see why that is necessarily the case. Even CRF mode uses mbtree by default, which is a pretty complicated rate control algorithm. x264 also has pretty intelligent keyframe determination, I…

> Given that x264 already has a 2 pass mode, I don't see why that is necessarily the case. Even CRF mode uses mbtree by default, which is a pretty complicated rate control algorithm. x264 also has pretty intelligent keyframe determination, I almost always see I frames on scene transitions.

x264 will not align keyframes across resolutions and encodes. In addition the pershot encodes optimize more than just idr frame placement. They also optimize other encoder parameters such as aq.

> I think it's probably the other way around. The closer you are to a screen, the more likely you are to notice increased resolution. But if there are large patches of the image full of artifacts, you'll be likely to see that even far away.

That isn't how this works. It's not a strict tradeoff between more artifacts and less sharpness by changing resolution. Downscaling -> Upscaling is simply another form of lossy compression. It may look better or worse than using those bits in another spot.

Re: Netflix is now doing per-shot encoding for UHD content

#112
post #20

> Sometimes we ingest a title that would need more bits at the highest end of the quality spectrum — even higher than the 16 Mbps limit of the fixed-bitrate ladder. From just a cursory inspection using my Apple TV 4K, 12 Mbps is their target bitrate but their ceiling was ~16 Mbps. That's still only a third of what AppleTV+ offers (36/48) and only 2/3 of Disney+ (18/24). Netflix is still higher than Prime Video (10/14…

I've noticed that ATV+ looks the best, which is much appreciated. However, what has been driving me insane with all these services is how the bitrate is completely inconsistent throughout, depending on network congestion. Every service I subscribe to will "automagically" lower the bitrate if the network can't handle it. Which is fine, I get it. The thing is, it's the only way to watch anything, and depending on the c…

Under your profile settings you should be able to force HD. It will cause it to buffer instead of downgrade if your internet gets too slow, but it will also do a bigger buffer (depending on the device and how much memory the device makes available to Netflix for the video buffer).

Re: Netflix is now doing per-shot encoding for UHD content

#113

Earlier quoted context omitted.

Existing encoders have suported this for ages using multipass. In the first pass of multipass encoding, the input data from the source clip is analyzed and stored in a log file. In the second pass, the collected data from the first pass is used to achieve the best encoding quality. In video encoding, two-pass encoding is usually controlled by the average bitrate setting or by the bitrate range setting (minimal and ma…

My point is that if Netflix thinks they can do better, it would be great to see their code contributed to the public, since they're using an open source program to do all their encodes. Also, you're making a slight mistake. About a decade ago (?), x264 was changed so that even 2-pass mode is really just using CRF under the hood. It's not "achieving the best quality", it's just figuring out what quantizers you need to…

> My point is that if Netflix thinks they can do better, it would be great to see their code contributed to the public, since they're using an open source program to do all their encodes.

This really is their core business and somewhere they can have a competitive edge, though. Even if you think it's unethical or that it might make business sense to contribute back to the upstream projects, you can see why they might want to keep some of that secret sauce in-house.

Re: Netflix is now doing per-shot encoding for UHD content

#114
post #96

Earlier quoted context omitted.

> This does a first entire pass on the film holistically to determine where keyframes should go and settings per-shot. It can't be backported to codecs because they work linearly. Given that x264 already has a 2 pass mode, I don't see why that is necessarily the case. Even CRF mode uses mbtree by default, which is a pretty complicated rate control algorithm. x264 also has pretty intelligent keyframe determination, I…

> Given that x264 already has a 2 pass mode, I don't see why that is necessarily the case. Even CRF mode uses mbtree by default, which is a pretty complicated rate control algorithm. x264 also has pretty intelligent keyframe determination, I almost always see I frames on scene transitions. x264 will not align keyframes across resolutions and encodes. In addition the pershot encodes optimize more than just idr frame p…

> x264 will not align keyframes across resolutions and encodes. In addition the pershot encodes optimize more than just idr frame placement. They also optimize other encoder parameters such as aq.

Sure, that's true. (Though I don't know why it matters that keyframes aren't aligned.) But at the end of the day the point is that Netflix has a better rate control algorithm, and this could be built into x264, even if it might require a significant amount of work. (Which I'm sure the x264 developers would be willing to do for a substantial quality improvement.)

> That isn't how this works. It's not a strict tradeoff between more artifacts and less sharpness by changing resolution.

Of course it's not a strict tradeoff. It's a loose one. And yes, it may look better or worse. That's really my only point in that section of the comment: that bumping up the resolution earlier in the ladder as they're doing is not a pure win, and it may look worse to some people depending on their viewing conditions.

Re: Netflix is now doing per-shot encoding for UHD content

#115

Earlier quoted context omitted.

My point is that if Netflix thinks they can do better, it would be great to see their code contributed to the public, since they're using an open source program to do all their encodes. Also, you're making a slight mistake. About a decade ago (?), x264 was changed so that even 2-pass mode is really just using CRF under the hood. It's not "achieving the best quality", it's just figuring out what quantizers you need to…

> My point is that if Netflix thinks they can do better, it would be great to see their code contributed to the public, since they're using an open source program to do all their encodes. This really is their core business and somewhere they can have a competitive edge, though. Even if you think it's unethical or that it might make business sense to contribute back to the upstream projects, you can see why they might…

Fair enough, I'm not arguing that they're obligated to or anything, I just think it would be nice. I do suspect that catalogue matters much more at this point than any tiny competitive advantage they get through better encoding. And they've certainly been willing to share advances (like VMAF) in the past - that's why this tech blog exists, after all!

Re: Netflix is now doing per-shot encoding for UHD content

#116
post #81
post #78

Earlier quoted context omitted.

> so we're supposed to be happy about a variable bitrate and quality because it saves them some bandwidth? yes, because it saves you money - netflix could be increasing its subscription cost, or it could keep it down as the subscriber base grows, by using technique like this. As long as you don't notice the difference, what's wrong with them saving some bandwidth?

Why is raising their subscription price the alternative? Wouldn't Netflix's capability to negotiate peering/transit deals grow along with their subscriber base?

as bandwidth grows, people's choice is to keep upping their fidelity. If the subscriber base was OK with a 480p video, they would've seen it. And negotiating peering/transit deals are fickle and isn't guaranteed to work as cable companies may be playing politics/business games to squeeze netflix.

Therefore, a technical solution is the next best option.

Re: Netflix is now doing per-shot encoding for UHD content

#117
post #20

> Sometimes we ingest a title that would need more bits at the highest end of the quality spectrum — even higher than the 16 Mbps limit of the fixed-bitrate ladder. From just a cursory inspection using my Apple TV 4K, 12 Mbps is their target bitrate but their ceiling was ~16 Mbps. That's still only a third of what AppleTV+ offers (36/48) and only 2/3 of Disney+ (18/24). Netflix is still higher than Prime Video (10/14…

> only a third of what AppleTV+ offers (36/48) and only 2/3 of Disney+ (18/24)

I'm very suspicious of these numbers, I think they might be the maximum transient bitrate and not the average bitrate. Do you have an example of an AppleTV movie or show that actually has an average bitrate that high?

Re: Netflix is now doing per-shot encoding for UHD content

#118
post #49

Earlier quoted context omitted.

And this is why I still get discs by mail. No dropouts, no unexplained drops in resolution, and it has a deeper catalog.

Scratched discs.

Actually, hasn't happened all that often. I've had more of a problem with discs arriving broken.

Re: Netflix is now doing per-shot encoding for UHD content

#119

Earlier quoted context omitted.

> They may even have made it worse: from the "ladder" comparisons, it looks like they jump to higher resolutions at lower average bitrates now, so if you're stuck at 1080p you're going to be getting worse quality after these changes than before. No they have not made it worse. 1080p encoded at lower bitrate can look better than 720p at a higher bitrate. Or vice versa. Even to the trained eye. It depends on the scene…

> No they have not made it worse. 1080p encoded at lower bitrate can look better than 720p at a higher bitrate. Or vice versa. Even to the trained eye. It depends on the scene dynamics.* Well, of course that's correct. Take 1080p encoded at 100 Mbps and 720 encoded at 300 Mbps, I guarantee you that 1080p wins every time. :-) > In the ladders they posted (called a RD chart) we can clearly see they have made a better s…

> Reread my original post carefully - my point is that if you're stuck with 1080p as the maximum resolution, than the quality you can get with the revised ladder is strictly worse, because Netflix will want to jump up to UHD resolutions, but your device won't support it.

These are for their HEVC encodes. Apple (and most others) require H264 to have a separate ladder which will be 1080p limited and will be generated on different encode set and maximum video quality.* Almost any HEVC capable device can go to 4k, even if the screen is only 1080p. It will be used than down scaled.

> (And even assuming that the UHD will be better based on this chart is kind of a leap, because it depends on what artifacts you're most sensitive to. Objective metrics ≠ subjective experience. In several of their comparisons, I prefer the lower res version because the new one is simply too artifacted.)

Certainly objective and subjective metrics have differences, but VMAF does correlate pretty tightly with subjective metrics. This is a very detailed subject, I summed up many of my thoughts on the differences in my demuxed talk last year here: https://www.youtube.com/watch?v=nCUsXhSPyyw

* https://developer.apple.com/documentation/http_live_streamin... 1.23 iirc

Re: Netflix is now doing per-shot encoding for UHD content

#120

Earlier quoted context omitted.

> Given that x264 already has a 2 pass mode, I don't see why that is necessarily the case. Even CRF mode uses mbtree by default, which is a pretty complicated rate control algorithm. x264 also has pretty intelligent keyframe determination, I almost always see I frames on scene transitions. x264 will not align keyframes across resolutions and encodes. In addition the pershot encodes optimize more than just idr frame p…

> x264 will not align keyframes across resolutions and encodes. In addition the pershot encodes optimize more than just idr frame placement. They also optimize other encoder parameters such as aq. Sure, that's true. (Though I don't know why it matters that keyframes aren't aligned.) But at the end of the day the point is that Netflix has a better rate control algorithm, and this could be built into x264, even if it m…

> Sure, that's true. (Though I don't know why it matters that keyframes aren't aligned.) But at the end of the day the point is that Netflix has a better rate control algorithm, and this could be built into x264, even if it might require a significant amount of work. (Which I'm sure the x264 developers would be willing to do for a substantial quality improvement.)

You can't ABR adapt without aligned GOP boundaries.

> Of course it's not a strict tradeoff. It's a loose one. And yes, it may look better or worse. That's really my only point in that section of the comment: that bumping up the resolution earlier in the ladder as they're doing is not a pure win, and it may look worse to some people depending on their viewing conditions.

Of course not, that's why the perform an analysis of both options and select the better one. That's what the algorithm does...

Post reply on HN