Add support for BT.2100 color space on NDI input#1334
Conversation
Trouffman
left a comment
There was a problem hiding this comment.
Couple notes :
When selecting the source to be BT2100 this set the colorspace to value "5", even tho this is defined as 3 in the plugin code (L64) -> this seems to be the order defined by OBS in video-io.h.
Changing from VIDEO_CS_2100_HLG to VIDEO_CS_2100_PQ give 4 and VIDEO_CS_DEFAULT give 0, which is the order it is defined in video-io
Maybe the following need to be revised, if this even used ?
#define PROP_YUV_SPACE_BT601 1
#define PROP_YUV_SPACE_BT709 2
#define PROP_YUV_SPACE_BT2100 3
Documentation note :
- Let's highlight that we use Rec. 2100 color space, HLG transfer type. Because OBS let user pick 2100 PQ or HLG.
- Let's document also why we only use 2100 HLG.
|
@Trouffman I have to respectfully disagree with your changes. Changing the switch statement in prop_to_colorspace to return VIDEO_CS_DEFAULT for the new BT2100 nullifies this new addition as there is no way to get the matrix parameters for BT2100_HLG from the video_format_get_parameters. Also, the #defines for the PROPs in ndi-source have no relation to the actual values used in OBS, as that is what the prop_to_colorspace function does. I made a new commit to back out your changes. Regarding documenting why we only use HLG:
Providing a way for the user to choose between HLG and PQ actually has no effect. So it was just labeled BT2100. |
|
Thanks for the details! No problem on the override! Next step : confirm proper behavior is observed and this will be merged! |
|
I don't know a way to verify the resulting color conversion within OBS is correct. All we can do is to make sure the parameters output by video_format_get_parameters are different for all 6 combinations (3 color space x 2 range): This shows that all 6 combinations do indeed produce different parameters. To verify the Output color space selection is independent of the input color space, I changed the Output color space to 2100 HLG and Full and dumped the parameters for the 2100Full input settings and got the same parameters. *With OBS Output colorspace 2100 HLG and Full Range |
|
I have experience the same on MacOs for testing. Good to go then. |
This PR adds the ability for the user to select BT.2100 as the color space for the an NDI source. It also moves the calculation of the color space conversion matrices to when the user changes the option, instead of recalculating on every frame.
This issue is reported in issue 1333 and is fixed by this PR.
Testing can be done by using the Test Patterns App in NDI Tools. Selecting the HDR option will send NDI in the BT.2100 color space.