I'm implementing an API that allows the user to send a video stream and generate thumbnails. I'm using asp.net core and Azure Blob Storage. The interface of API is this:
[HttpPost]
[Route("test_upload")]
public IActionResult TestUpload( IFormFile mediaFile ) {
//->store mediaFile
//->generate thumbnail
//->save thumbnail
return Ok();
}
I need to do two main things:
- Generate a thumbnail
- Get video information such as the duration
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?
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 2Mb and 30 seconds long. 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.
Any idea? Thanks!
Update 1: 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.