title: Efficiently handling streaming mjpeg
body: <p>I have an android tablet app that streams an mjpeg stream from an ipcamera using an instance of java.io.DataInputStream. This works great when I'm streaming a single stream of mjpeg data. I'd like to be able to stream multiple streams in a gridview. This doc explains the ideal layout:</p>
  
  <p><a href="https://docs.google.com/document/d/1j0pC5BGzgSN2NRQGfsF7eUugf-n54eBpI9ZeC-5KKKI/edit?usp=sharing" rel="nofollow">https://docs.google.com/document/d/1j0pC5BGzgSN2NRQGfsF7eUugf-n54eBpI9ZeC-5KKKI/edit?usp=sharing</a></p>
  
  <p>For NDA reasons, I can't give out all the source code but I can provide the javadoc for what I have so far:</p>
  
  <p><a href="http://jumpstar.www57.a2hosting.com/camView/index.html" rel="nofollow">http://jumpstar.www57.a2hosting.com/camView/index.html</a></p>
  
  <p>I've been able to display the same camera stream 4 times in a gridview but unfortunately the device starts running extremely slowly.</p>
  
  <p>Does anyone have any suggestions on how I can support 4 live streams while keeping the memory/cpu usage low? I was thinking maybe downrezing the framerate for some of the streams or  grabbing less data at every frame (somehow?). I'm open to anything at this point that will allow a somewhat live stream of 4 cameras at once.</p>
  
  <p>Thanks for the help!</p>