title: Reading a file located in memory with libavformat
body: <p>I'm currently trying to read small video files sent from a server</p>
  
  <p>In order to read a file using libavformat, you are supposed to call</p>
  
  <pre><code>av_open_input_file(&amp;avFormatContext, "C:\\path\\to\\video.avi", 0, 0, 0);
  </code></pre>
  
  <p>The problem is that in this case the file is not on the disk, but in memory.</p>
  
  <p>What I'm doing for the moment is downloading the file, writing it on the disk using a temporary name, and then calling <code>av_open_input_file</code> with the temporary file name, which is not a very clean solution.</p>
  
  <p>In fact what I want is a function like <code>av_open_custom(&amp;avFormatContext, &amp;myReadFunction, &amp;mySeekFunction);</code> but I didn't find any in the documentation.
  I guess it is technically possible, since the name of the file is not something that helps the library determine which format it is using.</p>
  
  <p>So is there a function like this, or an alternative to av_open_input_file?</p>