I can't figure out how to make libVLC read a video file and output the current frame to a pixel array. I found an example using SDL and another using SFML, but I don't understand how to make use of them.
I want to extract a frame and copy the data to an array in the form of
Code: Select all
int pixelarray[imagewidth*imageheight*4]
where pixelarray[i*j*4] would be the red int, pixelarray[i*j*4+1] would be green, pixelarray[i*j*4+2] would be blue and pixelarray[i*j*4+3] would be the alpha.
I would like to avoid all non-libvlc code except standard C++98. I guess if it is absolutely required, boost would be ok too.
Where and how can I get this data? And when can I copy it to a local array safely?