title: Streaming Videos via WebAPI
body: <p>I want to stream a video via my web API, I use ASP.NET Core. Normally, I would do something like this:</p>
  <pre><code>[ApiController]
  [Route(&quot;[controller]&quot;)]
  public class MyController : ControllerBase
  {
       [...]
       public IActionResult Get()
       {     
         return File(System.IO.File.OpenRead(&quot;file&quot;), &quot;video/mp4&quot;);
      }
   }
  </code></pre>
  <p>But the video does not exist at the time of the request, it should be created live. This means, the video does not have a predefined length (should be created as long as the web client requests the video) and its content should be created live.</p>
  <p>A simple example would be: I want to have a WebAPI, which returns a video, which always contains the current time. As long as have my browser opened <code>http://localhost/My/</code></p>
  <p>I want to see a live video with the current time.</p>
  <p>So I have to tasks:</p>
  <ul>
  <li>How do I stream a video with no fixed length?</li>
  <li>How can I create a video live (e.g. draw a string into the video) and return it?</li>
  </ul>