2017-11-10, 12:41
I'd like to know what's the best output colour space for Kodi on the Raspberry Pi.
There have been some threads about this before - notably https://forum.kodi.tv/showthread.php?tid=252023 - but a) they tend not to come to any firm conclusions, with a lot of conflicting statements, b) they're old enough that any authoritative-sounding posts pre-date Kodi v17 (and in many cases even pre-date Kodi v16), and c) they mostly focus on Kodi running on Intel hardware, which doesn't necessarily work the same way as Kodi running on an RPi, and (I think) gives you additional configuration options within Kodi itself that I don't seem to have! So I hope no one minds if I start a new thread about it.
I'm running LibreELEC (currently at v8.2.0.1) on a Raspberry Pi 3. (If I could get better results by running Kodi a different way, I'd be happy to switch!). The output from the RPi 3 goes to a Lumagen RadiancePro video processor, and from there to an LG G6 television. The RadiancePro does all kinds of interesting and helpful things, such as particularly-good-quality upscaling, 3D LUT colour correction, and so on. But to work at its best, the signal you feed it needs to be in the most "raw" form possible - in other words, as close as possible to the original video-file data.
The majority of video material is encoded as YCbCr, 4:2:0, and uses 16 for black and 235 for white (as opposed to the RGB, 4:4:4, 0-255 space that is used by most computers). So, ideally, I would want the RPi3 to output the original YCbCr 4:2:0 video data, and let the RadiancePro deal with everything from that point on. (If this results in the Kodi UI getting a little messed up, I'm absolutely fine with that, so long as the video itself is pristine).
The question is, how close can one get to passing through the raw video data? My RPi 3 with LibreELEC defaults to RGB output rather than YCbCr, and I think also defaults to 0-255. I've discovered that it's possible to make it output YCbCr 16-235 by changing the config.txt file in the boot directory, and setting the hdmi_pixel_encoding value - I'm currently experimenting with setting it to 3. But there are two possible issues with that.
The first is that it's now outputting YCbCr 4:4:4. YCbCr 4:2:2 would be better, and 4:2:0 would be better still, but I haven't yet found a way to make it do that. Is that possible?
The more serious issue, though, is the question of whether, if we do output YCbCr, is Kodi/LibreELEC really giving us the original video information (plus minimal chroma upsampling if we're at 4:2:2 or 4:4:4), or are there actually other colour space transformations going on internally? In the aforementioned earlier threads, there is some talk about Kodi actually translating the original YCbCr 16-235 videodata into RGB 0-255 internally, in order to composite it with the Kodi GUI (although there doesn't seem to be a consensus about whether this happens on the RPi 3 specifically, or whether Kodi 17 or 18 works the same way as earlier versions in that respect). If that's true, then setting the output colour space to YCbCr, and particularly setting it to YCbCr 16-235, is actually going to introduce a second colour space transformation, and further corrupt the video data, and outputting RGB 0-255 is likely to look better.
Does anyone know, definitively, whether Kodi 17 or 18 on the Raspberry Pi 3 actually does this?
And, in general, I welcome any thoughts on how to get the absolute minimum possible colour space translations across the entire pipeline.
There have been some threads about this before - notably https://forum.kodi.tv/showthread.php?tid=252023 - but a) they tend not to come to any firm conclusions, with a lot of conflicting statements, b) they're old enough that any authoritative-sounding posts pre-date Kodi v17 (and in many cases even pre-date Kodi v16), and c) they mostly focus on Kodi running on Intel hardware, which doesn't necessarily work the same way as Kodi running on an RPi, and (I think) gives you additional configuration options within Kodi itself that I don't seem to have! So I hope no one minds if I start a new thread about it.
I'm running LibreELEC (currently at v8.2.0.1) on a Raspberry Pi 3. (If I could get better results by running Kodi a different way, I'd be happy to switch!). The output from the RPi 3 goes to a Lumagen RadiancePro video processor, and from there to an LG G6 television. The RadiancePro does all kinds of interesting and helpful things, such as particularly-good-quality upscaling, 3D LUT colour correction, and so on. But to work at its best, the signal you feed it needs to be in the most "raw" form possible - in other words, as close as possible to the original video-file data.
The majority of video material is encoded as YCbCr, 4:2:0, and uses 16 for black and 235 for white (as opposed to the RGB, 4:4:4, 0-255 space that is used by most computers). So, ideally, I would want the RPi3 to output the original YCbCr 4:2:0 video data, and let the RadiancePro deal with everything from that point on. (If this results in the Kodi UI getting a little messed up, I'm absolutely fine with that, so long as the video itself is pristine).
The question is, how close can one get to passing through the raw video data? My RPi 3 with LibreELEC defaults to RGB output rather than YCbCr, and I think also defaults to 0-255. I've discovered that it's possible to make it output YCbCr 16-235 by changing the config.txt file in the boot directory, and setting the hdmi_pixel_encoding value - I'm currently experimenting with setting it to 3. But there are two possible issues with that.
The first is that it's now outputting YCbCr 4:4:4. YCbCr 4:2:2 would be better, and 4:2:0 would be better still, but I haven't yet found a way to make it do that. Is that possible?
The more serious issue, though, is the question of whether, if we do output YCbCr, is Kodi/LibreELEC really giving us the original video information (plus minimal chroma upsampling if we're at 4:2:2 or 4:4:4), or are there actually other colour space transformations going on internally? In the aforementioned earlier threads, there is some talk about Kodi actually translating the original YCbCr 16-235 videodata into RGB 0-255 internally, in order to composite it with the Kodi GUI (although there doesn't seem to be a consensus about whether this happens on the RPi 3 specifically, or whether Kodi 17 or 18 works the same way as earlier versions in that respect). If that's true, then setting the output colour space to YCbCr, and particularly setting it to YCbCr 16-235, is actually going to introduce a second colour space transformation, and further corrupt the video data, and outputting RGB 0-255 is likely to look better.
Does anyone know, definitively, whether Kodi 17 or 18 on the Raspberry Pi 3 actually does this?
And, in general, I welcome any thoughts on how to get the absolute minimum possible colour space translations across the entire pipeline.