title: FFmpeg NaCl module avformat_open_input (on rtsp stream) returns -5: I/O error
body: <p>I want to create an RTSP player in Chrome PNaCl.</p>
  
  <p>I have successfully built the ffmpeg naclport including the following networking flags in the <strong>build.sh</strong> file for the ffmpeg NaCl port.</p>
  
  <p><em>--enable network --enable-protocols --enable-demuxer=rtsp --enable-demux=rtp --enable-demuxer=sdp --enable-decoder=h264</em></p>
  
  <p>Furthermore, I have successfully coded and the linked the ffmpeg NaCl port in my own PNaCl module. I have included the following network permissions in the manifest.json file:</p>
  
  <pre><code>"permissions": [
  {
      "socket": [
          "tcp-listen:*:*", 
          "tcp-connect:*:*", 
          "resolve-host:*:*", 
          "udp-bind:*:*", 
          "udp-send-to:*:*"
      ],
  }
  </code></pre>
  
  <p>Now once I run the following code, in PNaCl, the <strong>avformat_open_input(...) returns -5 or I/O Error</strong>:</p>
  
  <pre><code>    AVFormatContext* formatContext = avformat_alloc_context();
  
      av_register_all();
  
      avformat_network_init();
  
      const char * stream_path = "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov";
  
      int result = avformat_open_input(&amp;formatContext, stream_path ,NULL,NULL);
  
      if(result&lt; 0){
  
          PostMessage("input not opened, result: ");
  
          PostMessage(result);
  
      }else{
  
        PostMessage(std::string("input successfully opened"));
  
      }
  </code></pre>
  
  <p>What am I possibly doing wrong, and why can't the PNaCl module access the RTSP stream?</p>
  
  <p><em>PS. <a href="https://stackoverflow.com/questions/17854270/avformat-open-input-return-value-error-code-on-nacl-module">This</a> is a similar question, but it gives no definitive answer.</em></p>