GetPixels from an ogv video file.

Like the title suggests, I need to read the data from an .ogv video file. There are plenty of plugins that provide playing the files on a texture, but none of them give me access to the pixels of each frame as it’s streamed. I have data stored in the pixels of the movie, so I don’t actually want to stream the movie to a texture in game, I want to use the pixels to create other data.

To clarify, I do not want to render the video at all, because I don’t need to display the movie, I’m simply trying to access data in the movie.

Is something like this possible?

As long as you can play (i.e. render video) into RenderTarget or screen, then you can read it into a texture and get pixels from that. Texture2D.ReadPixels (Unity - Scripting API: Texture2D.ReadPixels) reads from active RenderTexture (you can change it by setting RenderTexture.active).

I ended up just writing an FFmpeg plugin to stream the frame data from the video instead. It doesn’t look like Unity provides this any way by default.