I currently has a system that uploads videos to Azure blob storage and works fine. I would like to implement a feature that grabs a thumbnail from the video while uploading and pushes it to Azure as well.
I tried using this as suggested:
new FFMpegConverter().GetVideoThumbnail(file, outputJPEG);
The problem is that I am not sure what to use as outputJPEG as I don't have a file I am writing to, but rather want to write that file to Azure's blob storage.
Can anyone help me figure out this issue, or perhaps suggest an alternative method?
I have tried:
Creating a new, empty HttpPostedFileBase as the outputJPEG file but this is impossible as it only accepts user uploaded files.
Using filestream but this does not seem to work as it requires a location of a file it's writing to, rather than letting me just push to the blob storage. (via: blob.UploadFromStream(file.InputStream);)
Thanks in advance for any help!
Note that GetVideoThumbnail method always creates temporary file for output jpeg file even when overload that accepts Stream is used.
If you goal is to avoid creation of temporary file you can use FFMpegConverter.ConvertLiveMedia overload that accepts inputSource from file and writes result to output stream (extracting video thumbnail is equivalent to conversion to MJPEG stream with only 1 frame).
It looks like there is an override that takes a stream, so you could write it to a memory stream and then take the memory stream and create a new file in the blob store: