News for hackers. Stuff that matters.
Re:Netflix is now doing per-shot encoding for UHD content by zbobet2012 on Friday August 28, 2020 @09:05PM (#24312310)
> 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 dynamics.* In the ladders they posted (called a RD chart) we can clearly see they have made a better selection of the resolution to encode at a given target bitrate increase the video quality. They have posted the BD rates for this stuff, the gains are substantial (30% or more visual quality at the same bitrate).

> Also, something that's kind of weird about all this is that encoders (x264, x265, etc) already have their own rate control algorithms that decide on a frame or scene basis how many bits to use. Netflix taking an approach like this is equivalent to claiming that they're capable of doing a better job than these codecs in an automated way - so why not just contribute the code needed to achieve these improvements back to the projects they're using?

Because they've built a split and stitch encoder on top of the codecs. That means the code is built around x264, not into it.

> Last, it's very weird to select individual frames from an encode and not a selection of frames. The comparisons purport to show that the lower bitrate encode is better than the higher bitrate encode, but in fact (if I understand how they're using rate control correctly) what they are showing is a single frame in the lower bitrate encode that uses more bits than the same frame in the higher bitrate encode. So it's arguably not a fair comparison. And even with that, depending on how sensitive you are to artifacts, some of the "optimized ladder" encodes still look worse.

This is extremely true.

* High action scenes tend to benefit from lower resolution with more bits spent on inter compression while slower scenes benefit from tighter intra compression.

Re:Netflix is now doing per-shot encoding for UHD content by bscphil on Friday August 28, 2020 @09:17PM (#24312388)
> 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 selection of the resolution to encode at a given target bitrate increase the video quality.

I understand how an RD chart works, but I disagree with your conclusions. 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. (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.)

> Because they've built a split and stitch encoder on top of the codecs. That means the code is built around x264, not into it.

I understand the technical difference, but I'm still not convinced. Fundamentally what you get at the end of the day is a single continuous h.264 stream. The quantizer is chosen based on some rate control algorithm, and IPB frame choices are made by another algorithm. Netflix's improvement amounts to having a better rate control, that understands scene differences and uses lower quantizers on more complex scenes. There's fundamentally no reason why you couldn't add such a rate control algorithm to x264. It might require using a 2-pass mode, but it could be done.

Re:Netflix is now doing per-shot encoding for UHD content by wmf on Saturday August 29, 2020 @12:39AM (#24313591)
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.

"As a side note, we do have some additional points, not shown in the plots, that are used in resolution limited scenarios — such as a streaming session limited to 720p or 1080p highest encoding resolution. Such points lie under (or to the right of) the convex hull main ladder curve but allow quality to ramp up in resolution limited scenarios."

Re:Netflix is now doing per-shot encoding for UHD content by zbobet2012 on Friday August 28, 2020 @09:50PM (#24312583)
> 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 by bscphil on Friday August 28, 2020 @10:05PM (#24312662)
> These are for their HEVC encodes.

Really? I wasn't aware Netflix even offered anything other than H.264 at <= 1080p. I know Youtube doesn't. If this is all HEVC maybe you're right and the resolution issue isn't such a big deal. If this is actually the case I wish they would have said so explicitly in the blog post.

> 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

Thanks, I'll check that out when I have the time. I'd still emphasize that it's quite possible for objective metrics to be fooled (that's why codecs have psy tunings!), and I do prefer several "old-ladder" images over the newer versions in Netflix comparisons here. I suppose I've become rather cynical about claims made on the basis of metrics ("now 50% less bitrate for the same quality!"), when to my eye, web video has always been very bad and is getting worse as companies keep reducing the bitrate.

Re:Netflix is now doing per-shot encoding for UHD content by namibj on Saturday August 29, 2020 @03:15AM (#24314323)
Youtube offers various codecs, also including VP8 at all resolution/framerate settings H.264 is offered on (not all formats will always be available). For example, here's the youtube-dl format list for a well-known video:

  [youtube] dQw4w9WgXcQ: Downloading webpage
  [info] Available formats for dQw4w9WgXcQ:
  format code  extension  resolution note
  249          webm       audio only tiny   49k , opus @ 50k (48000Hz), 1.18MiB
  250          webm       audio only tiny   65k , opus @ 70k (48000Hz), 1.55MiB
  140          m4a        audio only tiny  130k , m4a_dash container, mp4a.40.2@128k (44100Hz), 3.27MiB
  251          webm       audio only tiny  136k , opus @160k (48000Hz), 3.28MiB
  394          mp4        256x144    144p   73k , av01.0.00M.08, 25fps, video only, 1.72MiB
  278          webm       256x144    144p   97k , webm container, vp9, 25fps, video only, 2.25MiB
  160          mp4        256x144    144p  107k , avc1.4d400c, 25fps, video only, 2.05MiB
  395          mp4        426x240    240p  159k , av01.0.00M.08, 25fps, video only, 3.42MiB
  242          webm       426x240    240p  217k , vp9, 25fps, video only, 4.04MiB
  133          mp4        426x240    240p  290k , avc1.4d4015, 25fps, video only, 4.48MiB
  396          mp4        640x360    360p  340k , av01.0.01M.08, 25fps, video only, 6.68MiB
  243          webm       640x360    360p  396k , vp9, 25fps, video only, 6.96MiB
  134          mp4        640x360    360p  484k , avc1.4d401e, 25fps, video only, 8.27MiB
  244          webm       854x480    480p  586k , vp9, 25fps, video only, 10.03MiB
  397          mp4        854x480    480p  603k , av01.0.04M.08, 25fps, video only, 11.37MiB
  135          mp4        854x480    480p  741k , avc1.4d401e, 25fps, video only, 11.56MiB
  247          webm       1280x720   720p 1035k , vp9, 25fps, video only, 17.67MiB
  136          mp4        1280x720   720p 1077k , avc1.4d401f, 25fps, video only, 16.72MiB
  398          mp4        1280x720   720p 1133k , av01.0.05M.08, 25fps, video only, 22.07MiB
  399          mp4        1920x1080  1080p 2106k , av01.0.08M.08, 25fps, video only, 40.74MiB
  248          webm       1920x1080  1080p 2666k , vp9, 25fps, video only, 58.46MiB
  137          mp4        1920x1080  1080p 4640k , avc1.640028, 25fps, video only, 78.96MiB
  18           mp4        640x360    360p  601k , avc1.42001E, 25fps, mp4a.40.2@ 96k (44100Hz), 15.19MiB (best)
Re:Netflix is now doing per-shot encoding for UHD content by sxp on Friday August 28, 2020 @11:10PM (#24313047)
Netflix has a debug screen that will show you the codec info. It varies depending on platform but you can Google it to find the one for your platform. For the Windows app, it's Ctrl-Alt-Shift-D. That shows H264 on my device since I don't have hardware that can decode H265. On Android, I've seen VP9 streams.
Re:Netflix is now doing per-shot encoding for UHD content by throwawaythekey on Friday August 28, 2020 @10:32PM (#24312847)
Youtube mostly uses vp9 these days (I think it might fallback to h264 depending on the device?)

You can confirm this by loading a video, right clicking somewhere in the player and opening 'stats for nerds'

Re:Netflix is now doing per-shot encoding for UHD content by munkiefish on Saturday August 29, 2020 @12:06AM (#24313392)
Re:Netflix is now doing per-shot encoding for UHD content by motoboi on Friday August 28, 2020 @11:03PM (#24313013)
Safari on Mac OS Catalina is always h264
Re:Netflix is now doing per-shot encoding for UHD content by MikusR on Saturday August 29, 2020 @12:04AM (#24313379)
Because Apple will invent(as in start supporting) vp9 with Big Sur.
Re:Netflix is now doing per-shot encoding for UHD content by iso1210 on Saturday August 29, 2020 @09:14AM (#24315842)
> 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. :-)

No it doesn't. Depending on the distance from the screen and indeed the screen resolution, you won't benefit from the extra 1080p resolution, but you could benefit from the extra bits. 1080p60 is 3.7GBit uncompressed with 10 bit 444, so that's 37:1 compression. 720p60 is 1.7gbit, or 5.5:1 compression, so far fewer compression artifacts.