title: Stuck in imread function while using android smartphone as camera in Matlab
body: <p>I have the following situation:</p>
  
  <ul>
  <li>Windows 10 host</li>
  <li>Linux (Bunsenlabs) on VirtualBox</li>
  <li>Android smartphone connected to PC and can be seen using lsusb</li>
  <li>DroidCam app on smartphone and DroidCam client installed on Linux, adb installed as well.</li>
  <li>Matlab R2017a installed on Linux.</li>
  </ul>
  
  <p>I'm using the following script:</p>
  
  <pre><code>url=('http://127.0.0.1:4747/mjpegfeed?640x480');
  ri  = imread(url);
  fh = image(ri);
  while(1)
      ri = imread(url);
      set(fh,'CData',ri);
      drawnow;
  end
  </code></pre>
  
  <p>Starting droidcam in Linux I get:</p>
  
  <pre><code>Device: Droidcam (v4l2loopback)
  Found driver: /dev/video0 (fd:5)
  connecting to 127.0.0.1:4747
  </code></pre>
  
  <p>Going in firefox and accessing 127.0.0.1:4747 I can clearly see the video feed from my smartphone.
  If I close the tab in firefox (to allow other devices to connect to the stream) and run the script in Matlab, the script would start and get stuck in imread().</p>
  
  <p>More exactly in line 76 from file urlreadwrite.m</p>
  
  <pre><code>isc.copyStream(inputStream,outputStream);
  </code></pre>
  
  <p>Once I reach there with the debugger, the camera opens on my smartphone (I can see that it also takes the resolution from the url - if I put 10x10, on my smartphone the image would be 10x10) but I can't use the debugger anymore, and no video frame appears in matlab. It looks like it's stuck in an infinite loop and can't pass from that second line.</p>
  
  <p>Does anybody know if this is a normal behavior for this function?<br>
  Did I do something wrong in this whole configuration?<br>
  Is there any alternative to that function?<br>
  Is there a better/easier way to capture video stream in Matlab from my android phone without using wifi, only on usb?</p>