Live data from Hacker News

Adventures with ffmpeg and color ranges

facebook.com

31–40 of 94 posts

Re: Adventures with ffmpeg and color ranges

#31

Its weird to think how John Carmack went from .plan files to Facebook Posts. I think it might be safe to say he had the most widely read .plan file in existence. Wish he would go back to it.

Maybe he was asked to publish all his communication on Facebook as part of his career move. Along with a large compensation. Unless he really believes Facebook is the right place to post this kind of things nowadays, who knows?

Re: Adventures with ffmpeg and color ranges

#32
post #27
post #8

Earlier quoted context omitted.

You think someone is telling Carmack where he can and can't post? Why one earth would they do that? And why on earth would he put up with it?

More that the company’s culture says you should post things using the company’s platform, and to not do so might be making a statement he doesn’t want to make. Otherwise, why would he move away from .plan?

Could it be that a lot of people don't know what a .plan file is, or how to read content from one?

Re: Adventures with ffmpeg and color ranges

#33
post #7

> This is usually visible as ugly banding or blocking in dark scenes. I was just complaining about this a couple weeks ago with some friends after the “Dark” episode of GoT. I was saying the codecs don’t seem to have caught up or they are just being fed at too low a bit rate to really excel at dark scenes. It’s hard to imagine this is just a scaling issue with the color ranges, and if so, how could it possibly not ha…

>I have a high end OLED screen in a very dark room, and I was very disappointed by the picture quality. Unfortunately for you, high end OLED in a very dark room is literally the most likely conditions under which you'd be annoyed by these problems... :-) HDR is the way to go.

It’s Dolby Vision from the ATV to the set, it’s the source encoding I assume that just couldn’t live up to material.

Perhaps bitrate compromises have to be made when you’re streaming to so many people at once, but it’s not usually so glaring.

Re: Adventures with ffmpeg and color ranges

#34
The best part about these blog posts is that people discuss the hosting service more than the content of the article at this point.

No one is nearly as interested in Carmack's thoughts on codecs as they are about the domain name of the server he's posting to.

And yet, we'd all read his stuff no matter where he puts it. But maybe he reaches more outsiders this way? I doubt it.

Re: Adventures with ffmpeg and color ranges

#36
post #27
post #8

Earlier quoted context omitted.

You think someone is telling Carmack where he can and can't post? Why one earth would they do that? And why on earth would he put up with it?

More that the company’s culture says you should post things using the company’s platform, and to not do so might be making a statement he doesn’t want to make. Otherwise, why would he move away from .plan?

You said 'it wasn't his decision to make' not 'perhaps he wants to use his employer's platform'. If you don't want to imply it's coercive, you should phrase it in a way that doesn't imply it's coercive.

Re: Adventures with ffmpeg and color ranges

#37
The ffmpeg documentation for YouTube videos[1] suggests using `-pix_fmt yuv420p` with H.264 and there are warnings against using other pixel formats (such as yuv444p) for compatibility reasons. Should the documentation instead be suggesting `-pix_fmt yuvj420p`? What are the risks associated with choosing that output format?

[1]: https://trac.ffmpeg.org/wiki/Encode/YouTube

Re: Adventures with ffmpeg and color ranges

#38
post #7

> This is usually visible as ugly banding or blocking in dark scenes. I was just complaining about this a couple weeks ago with some friends after the “Dark” episode of GoT. I was saying the codecs don’t seem to have caught up or they are just being fed at too low a bit rate to really excel at dark scenes. It’s hard to imagine this is just a scaling issue with the color ranges, and if so, how could it possibly not ha…

The Amazon 720P version had noticeable banding several times during that episode that was distracting even the day after so it's probably not a bandwidth issue, the Dothraki charge into the dark might have been a cool idea on paper but what a disappointment in execution. I think the director and cinematographer are just ignorant of how stuff gets delivered to consumers.

https://news.avclub.com/was-game-of-thrones-the-long-night-t...

Re: Adventures with ffmpeg and color ranges

#39

The ffmpeg documentation for YouTube videos[1] suggests using `-pix_fmt yuv420p` with H.264 and there are warnings against using other pixel formats (such as yuv444p) for compatibility reasons. Should the documentation instead be suggesting `-pix_fmt yuvj420p`? What are the risks associated with choosing that output format? [1]: https://trac.ffmpeg.org/wiki/Encode/YouTube

No, limited range is the most common and expected range for YUV videos. Many players don't look or respect the container metadata such as nclx in MP4 or the bitstream VUI flags and assume limited range.

Re: Adventures with ffmpeg and color ranges

#40
post #39

The ffmpeg documentation for YouTube videos[1] suggests using `-pix_fmt yuv420p` with H.264 and there are warnings against using other pixel formats (such as yuv444p) for compatibility reasons. Should the documentation instead be suggesting `-pix_fmt yuvj420p`? What are the risks associated with choosing that output format? [1]: https://trac.ffmpeg.org/wiki/Encode/YouTube

No, limited range is the most common and expected range for YUV videos. Many players don't look or respect the container metadata such as nclx in MP4 or the bitstream VUI flags and assume limited range.

This is correct. In fact, the following statement from the post is nonsense:

> For arcane reasons related to TV broadcast limitations, many video formats restrict the YUV color components to be in the 16..235 or 16..240 range instead of the full 0..255 range. Losing 14% of the already-barely-enough 8 bit dynamic range is bad enough, but it also often results in the black range starting at a quite visible grey value because most players don’t rescale the range. This is usually visible as ugly banding or blocking in dark scenes.

Of course players "rescale" the range. (It's not exactly rescaling, it's just that a value of 235 IS reference white in Rec. 709.) In fact, the thought if them not doing this is kind of crazy, as Rec. 709 (used in Blurays and elsewhere) as well as Rec. 601 explicitly use limited range YUV. Players that don't use limited range correctly would be out of spec and couldn't play a single Bluray disc correctly. So for the overwhelming majority of use cases, you want regular old yuv420p.

The author is picking up on something that actually happens, however. There are Blurays out there that have incorrectly converted YUV values. This happens when for example something is in limited range YUV, and then that data is passed to a converter that treats the data as full range YUV, and compresses it again to fit in limited range YUV. This "doubly compressed" data is embarrassingly common (maybe 5% or so of Blurays have this problem). If you get a Bluray like this, or any video with the same issue, the blacks will be bright grays and the whites will be dull (similar to how the author describes limited range YUV). The player on the end is reading the YUV values correctly, but the data has been doubly compressed so it only undoes one round of this.

The issue is well known in the pirate communities as an example. Reliable release groups always fix these broken Blurays in their encodes. This is usually described as "fixing levels" or something like that.

Post reply on HN