Search code examples
azurevideo-streamingblobazure-media-services

Capturing a video and uploading it to Azure Blob


I am working on a sample project where I want to capture video from a webcam and upload it directly to the blob without saving the video locally.

It should work in a such a way that it should not store the video locally. Is there any way to keep uploading the video source streaming that is being captured to Blob storage in parallel?


Solution

  • Technically this should be possible. Blob Storage allows you to upload your file in chunks and once you're done you can commit these chunks in a specific order:

    With these methods you can for example create a buffer in memory which stores the video and call PutBlock each time the buffer reaches a certain size. Then, once the recording is done you can call PutBlockList to commit all blocks. As a result, your blob will contain the complete recording without saving it to local disk first.