Decode MJPEG image on live stream

1.5k Views Asked by At

I am trying to view live video from my webcam. I can draw the image to a window using OpenGL, get the frames in YUV and convert them on the fly into RGB. I can convert YUV colors into RGB easily, as well as I can get a pointer to the data from the MJPEG. all I need is the ability to decode MJPEG into either YUV or RGB live. I have heard of libjpeg, as well as libjpeg-turbo, however, I do not know how to use either of them. I have libjpeg

If I use MJPEG (and shrink the image buffer so that I don't read memory that's not mine):

mjpeg random noise

If I use YUV422:

enter image description here

0

There are 0 best solutions below