title: ffmpeg starts too slow when using ip camera (the same as using OpenCV)
body: <p>Here is my code:</p>
  
  <pre><code>ffmpeg -i http://192.168.0.101:8889/video?dummy=param.mjpeg out.mjpg
  </code></pre>
  
  <p>When I run this command, it will immediately print below:</p>
  
  <pre><code>ffmpeg version N-70223-g7296716 Copyright (c) 2000-2015 the FFmpeg developers
    built with gcc 4.9.2 (GCC)
    configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
    libavutil      54. 19.100 / 54. 19.100
    libavcodec     56. 26.100 / 56. 26.100
    libavformat    56. 23.105 / 56. 23.105
    libavdevice    56.  4.100 / 56.  4.100
    libavfilter     5. 11.101 /  5. 11.101
    libswscale      3.  1.101 /  3.  1.101
    libswresample   1.  1.100 /  1.  1.100
    libpostproc    53.  3.100 / 53.  3.100
  </code></pre>
  
  <p>However, <strong>it takes almost twenty seconds before showing next line</strong>, and it prints <strong>this warning</strong>:</p>
  
  <pre><code>[mjpeg @ 0000000002c4fec0] Format mjpeg detected only with low score of 25, misdetection possible!
  </code></pre>
  
  <p>Then it prints this:</p>
  
  <pre><code>Input #0, mjpeg, from 'http://192.168.0.101:8889/video?dummy=param.mjpeg':
    Duration: N/A, bitrate: N/A
      Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 640x480 [SAR 1:1 DAR 4:3], 25 tbr, 1200k tbn, 25 tbc
  Output #0, mjpeg, to 'a.mjpg':
    Metadata:
      encoder         : Lavf56.23.105
      Stream #0:0: Video: mjpeg, yuvj420p(pc), 640x480 [SAR 1:1 DAR 4:3], q=2-31,
  200 kb/s, 25 fps, 25 tbn, 25 tbc
      Metadata:
        encoder         : Lavc56.26.100 mjpeg
  Stream mapping:
    Stream #0:0 -&gt; #0:0 (mjpeg (native) -&gt; mjpeg (native))
  Press [q] to stop, [?] for help
  frame=  195 fps=0.0 q=24.8 size=    1022kB time=00:00:07.80 bitrate=1073.6kbits/
  frame=  199 fps=185 q=24.8 size=    1043kB time=00:00:07.96 bitrate=1073.6kbits/
  frame=  203 fps=125 q=24.8 size=    1064kB time=00:00:08.12 bitrate=1073.6kbits/
  </code></pre>
  
  <p>What's worse, when I am using <code>OpenCV</code>, the <code>open</code> of the <code>VideoCapture</code> also takes the same long time!</p>
  
  <pre><code>#include "opencv2/opencv.hpp"
  #include &lt;iostream&gt;
  using namespace std;
  using namespace cv;
  
  int main(){
      cout&lt;&lt;"Start"&lt;&lt;endl;
      VideoCapture cap("http://192.168.0.101:8889/video?dummy=param.mjpg");
      cout&lt;&lt;"End"&lt;&lt;endl;
      return 0;
  }
  </code></pre>
  
  <p>20s after printing "start", it prints "end".</p>
  
  <p>I am using <code>ffmpeg</code> on win7 64 bit downloaded from <a href="http://ffmpeg.zeranoe.com/builds/" rel="nofollow">here</a>.</p>
  
  <p>Any idea will be appreciated!</p>