PDA

View Full Version : NDI Banding on Gradients



ZachSchuster
06-14-2017, 12:41 PM
I've noticed that with some graphics I'm pushing to NDI, either through my application or as a screen capture, there is noticeable banding of the gradient on the receiving side. Is this unavoidable due to the compression that is occurring since there such a wide range of colors in the gradient? Or is there something that can be done to improve it?

This appears on both the local machine sending and receiving, as well as my Tricaster and Video Monitor on other computers. The machines do have a 1Gb connection to my router, which is admittedly a residential vDSL modem but no other significant traffic occurring at the same time.

Examples can be found here: https://www.youtube.com/watch?v=K04-TthmdJs at time indexes: 2:15, 4:40, 4:55, and 5:15. Note that this being a YouTube video there is probably some additional quality loss, but I feel it is fairly accurate to what I am seeing in person. The NDI feed is 1920x1080.

Thanks,

livepad
06-19-2017, 11:45 AM
Zach - are you producing your graphics as RGB ? if so that may be the issue - converting RGBA to UYVY 8 Bit can produce this sort of issue.

If you created the gradient *natively* in UYVY you might find the banding goes away.

ZachSchuster
06-19-2017, 12:33 PM
We are using the WPF NDI Container. My understanding is that WPF only supports RGB coloring, so the WPF Container is probably doing conversion. Whether or not we'd get better results using the NDI Managed Send in place of the WPF Container, and thus have some more control over the conversion, I don't know.

livepad
06-20-2017, 03:59 AM
We are using the WPF NDI Container. My understanding is that WPF only supports RGB coloring, so the WPF Container is probably doing conversion. Whether or not we'd get better results using the NDI Managed Send in place of the WPF Container, and thus have some more control over the conversion, I don't know.

What I can tell you is that we hit the same issue with NDI SignalGenerator on the greyscale RAMP test pattern. An RGB PNG looked great, but delivering that via NDI as RGBA resulted in banding. Instead we create and store the Ramp as a YUV file and deliver as UYVY into NDI and it looks nice.

Not 100% certain of the mathematical reason but its almost certainly due to the losses made when converting RGB 4:4:4 to 8-bit YUV 4:2:2 - clearly YUV 4:2:2 is capable of holding a nice smooth Ramp, but it seems that a typical RGB to YUV conversion is probably making a consistent squeeze of 4:4:4 into 4:2:2 where you probably need a more weighted squeeze in order to end up with gradients being optimally represented in YUV.

I guess another approach might be to use dither but I don't have any direct experience with that other than using it in photoshop to reduce color palettes.

Hope this explains things. if someone has a better explanation I would certainly love to better understand this process.

JPulera
06-20-2017, 09:30 AM
NDI is video, and compressed video signals of any kind often have issues with smooth gradients as shown in your YT video. The source graphic may be uncompressed, and not always possible to faithfully recreate when adding compression for video. It may possibly help to add some dithering or noise to the graphic which can help the encoding process.

Thanks

ZachSchuster
06-20-2017, 11:32 AM
Doing some testing with adding a diamond plate image in the the background and making the gradient translucent... that is definitely better so I'll need to play around and see if I can find tweak it enough to my liking. Thanks guys.