QWidget Flickering for frame by frame streaming of video
-
@SilverSurfer said in QWidget Flickering for frame by frame streaming of video:
Could this be the reason for RGB /BGR mismatch ?
Well there is always Endianness but if using same sort of CPU in both ends, its likely not related to that.
-
@SilverSurfer
Ok. so most likely they
are just using openCV and send as BGR888So i dont see any way to convert to supported format without copy.
-
@wrosecrans said in QWidget Flickering for frame by frame streaming of video:
you can swizzle the r/g/b around arbitrarily when you do the drawing into the frame buffer
Could you provide sample code for the same ?
-
@SilverSurfer I don't have the time handy to do a full working example, but this is the technique in glsl:
https://www.khronos.org/opengl/wiki/Data_Type_(GLSL)#Swizzling(The vec4 can hold "rgba" values if that's what you put in it - the example there just calls it "xyzw" because the data type generically handles any 4 floats.)
Basically, start from an example that draws an image with a simple glsl shader as a texture. Then hack on the shader until it flips around the colors like you want when it draws the texture. Then use your code that gets the image over the network to upload the image as the OpenGL texture every frame.