title: Using FFMpeg with Asp .Net Core and video stream
body: <p>I'm implementing an API that allows the user to send a video stream and generate thumbnails. I'm using <em><strong>asp.net core</strong></em> and <em><strong>Azure Blob Storage</strong></em>. The interface of API is this:</p>
  <pre><code>    [HttpPost]
      [Route(&quot;test_upload&quot;)]
      public IActionResult TestUpload( IFormFile mediaFile ) {
          //-&gt;store mediaFile
          //-&gt;generate thumbnail
          //-&gt;save thumbnail
          return Ok();
      }
  </code></pre>
  <p>I need to do two main things:</p>
  <ol>
  <li>Generate a thumbnail</li>
  <li>Get video information such as the duration</li>
  </ol>
  <p>I tried to use libraries from Nuget, but all of this needs the file path and I don't have the file path, just the video Stream or the Blob from the Blob Storage after saving. So, my question is, how can I manage video directly from the stream using FFmpeg or another tool?</p>
  <p>I know Azure Media Services provide a lot of tools to manage media files such as videos and audio, but it's too slow for videos that are just <strong>2Mb and 30 seconds long</strong>. And I don't need to encode the video, create streams or other things like that. I just need to take video information from a Stream and store the video on the Storage.</p>
  <p>Any idea? Thanks!</p>
  <p><strong>Update 1:</strong>
  I wrote a workaround by creating a folder for temporary videos, I just save the video in this folder, create the thumbnail and delete the temp file. But I don't know if this practice has some bad side effects.</p>