I'm dealing with a couple of similar issues. In one project, I'm monitoring live video from a factory (the game simulates the factory, and you can access the live feed when you navigate around the 'game' version). In this case, we just grab frames from the video server, by detecting the effective resolution they will be displayed at, asking for that size, but no larger than a user-defined max (640x480 biggest we dare), and telling it JPEG with about 75% quality.
The other is sending webcam between two Unity's. In this case we really need good frame rate and quality, and that means good compression. Look at JPEG, MJPEG, and h.264 (the latter is preferred, but tricky to implement on either end).
So my message is: PNG may not be the best choice. You really need to compress that stuff as much as possible, and never send more pixels than will be viewed. Look into OpenCV. You may want to put the conversion and/or 'send' in their own threads too. Use a multi-core processor for sure.
If you have the means, probably approach 3 would be best, you can eliminate graphics rendering as a bottleneck that way.
↧