PDA

View Full Version : NDI video frame stride



gorbva
11-20-2018, 04:44 AM
When i cunstruct NDI videoframe i should set up a Stride - buffer where image stores. In SD stride calculates different ways. For RGB strid = 1920*4 (why 4?), for BRGA stride = 1920*8 +7 / 8.
But what stride should be for YUV? When i set 1920x4 , i have image shifted to left.
How to calculate correct stride for YUV?

livepad
11-20-2018, 04:49 AM
When i cunstruct NDI videoframe i should set up a Stride - buffer where image stores. In SD stride calculates different ways. For RGB strid = 1920*4 (why 4?), for BRGA stride = 1920*8 +7 / 8.
But what stride should be for YUV? When i set 1920x4 , i have image shifted to left.
How to calculate correct stride for YUV?

RGB is always RGBA (or BGRA) in NDI even if its actually BGRX (no alpha)
4 bytes per pixel So the byte stride is 4 x the XResolution

YUV is always UYVY in NDI
2 bytes per pixel (with UV chroma shared amongst pairs) So the byte stride is 2 x the XResolution