Dynamic texture / Video stream ?

Hello,

I need to be able to display a texture created in real time by an external proprietary application running on the same PC (in windows XP or 7).

I thought to several ways but I don’t know which is better

1/ My application writes the image on the HDD and I load it from the HDD in unity. I think this is the worst solution as my image may change at high rate (more than 1 time per second) and writing the image on the disk will be very heavy.

2/ My application creates a MapFile in shared memory and writes in it the raw bytes of my image. Then, through a plugin in Unity, I get the image raw bytes from the mapfile, I transform this into a jpg image in memory and transfers it into unity, then I use Texture2D LoadImage to create the texture and then I apply my texture. This seems heavy too.

3/ My application creates an internal webserver in the PC and I use WWW.texture to get my image. I think this way will be heavy as well and will not get good performances.

4/ My application creates a video stream (feed) in memory and unity get access to this video stream and displays it as a texture.
this solution sounds the best to me but I have no clue on how to realize it (from unity side)

what do you think ?

Thanks in advance for your help and your replies.

Antoine

If someone is still looking for a solution, this plugin can help.

FM Exhibition Tool Pack | Forum

You can stream game view / webcam / audio between multiple platforms in local network.
All written in C# and easy to modify.

Supported Platform: iOS/Android/Mac/PC