Hello all I am having the following code to save video to azure, which is working fine. But when I am loading the videos and trying to play them I am unable to play some of them. I am calling this using a service to execute for every 2 seconds to record the video from the angular service
- public async Task<int> Save(System.IO.Stream stream, string name)
- {
- MemoryStream memStream = new MemoryStream();
- stream.CopyTo(memStream);
- memStream.Position = 0;
-
- CloudStorageAccount storageAccount = CloudStorageAccount.Parse(AzureConfig.CONNECTION_STRING);
- CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
- ServiceProperties serviceProperties = await blobClient.GetServicePropertiesAsync();
-
- serviceProperties.DefaultServiceVersion = "2016-05-31";
-
- await blobClient.SetServicePropertiesAsync(serviceProperties);
-
- CloudBlobContainer container = blobClient.GetContainerReference("video");
-
- CloudAppendBlob appBlob = container.GetAppendBlobReference(name + ".webm");
- if (!await appBlob.ExistsAsync())
- {
- await appBlob.CreateOrReplaceAsync();
- }
- appBlob.Properties.ContentType = "video/webm;codecs=vp9";
- await appBlob.SetPropertiesAsync();
-
- appBlob.Metadata.Add(new KeyValuePair<string, string>("uploadedDate", DateTime.Now.ToString()));
-
- await appBlob.AppendFromStreamAsync(memStream);
-
- return 0;
- }
The video is getting uploaded but when I am trying to view the video some times the video is not getting displayed. I am using similar kind of this where for every 2 seconds I am calling a service to save the video in to azure
https://www.webrtc-experiment.com/RecordRTC/