unity3d-jp / FrameCapturer

export framebuffer, GBuffer or any RenderTextures from Unity to file. supported format: png, exr, gif, webm, mp4
MIT License
1.04k stars 164 forks source link

Get resulting frame as byte[] or color[]? #28

Closed Rich2020 closed 6 years ago

Rich2020 commented 6 years ago

Rather than writing to file, I'd like to have the captured frame put into a Queue<byte[]> or a Queue<Color[]>. I have managed to figure out how to do this, however, I am struggling to use the outputted frames. For example, I send the frame over the network, to a remote machine where the frame is to be displayed. How can I load the frame into a texture? I have tried Texture2D.SetPixels32 and Texture2D.LoadRawTexture, but neither of them work (they work when I send data across the network obtained using Texture2D.GetRawTextureData).

Does this plugin perhaps already have this capability? Perhaps I can stream the video being captured to a remote machine and if so, could I read in at a frame-by-frame basis?

i-saint commented 6 years ago

some encoders can do it but others (mainly WME (mp4)) can't do it. read the source if you want to know more about that.

adamroszyk commented 6 years ago

Any tips - what encoder you suggest ?