Mobile Streaming Video
This article presents a code example of how to use a streaming video image from a mobile phone into Processing and Max.
When you open the application you will see the following screen that configures the application.
Make sure that the Resolution (and Photo Resolution) is set to a medium level (a value of 640x480 should be enough), as bigger values may result to a slower playback rate. Set Quality from 50% up to 75% maximum. For the FPS Limit you could use No limit, or a simple 30fps should be enough. You can select Prevent going to sleep if you want your device to stream non-stop until you quit, and the rest options could remain with the default values. Next, we Start server and we see a new window with our live camera video and two buttons on the top left and right of the screen. We select How do I connect?, and then it is best that we choose I'm using Wi-Fi router (if we are not connected to a Wi-Fi router this will not work). Next window will show us the local IP of the device, and we need to make sure that we use this address in our code if we want to read the video frames.
Now that we broadcast video frames (as jpeg images) in our network, we can start using Processing or Max to read these frames, and use them in our composition if we like. In Processing, the code to read this address and put its contents in an image would be something like this:
And following, is the code for Max, that uses the exact same approach.