I have an MVC 4 application that contains a view to show "Videos" from azure blob storage of MP4 format only. Currently I'm using MediaElment.js(or any typical flash player) as the video player. How can I play these videos in a smooth streaming or progressive download(Adaptive streaming) method. What are the configurations that I have to set in Azure to support streaming? Is there anything that I have to do before uploading MP4 file to blob storage?
I have gone through this link
http://msdn.microsoft.com/en-us/spazuretrainingcourse_spblobstorageazure.aspx and as far as I understood, Windows Azure Blobs Uploader is used to upload video files to azure and silverlight as the client. In my case, the video is uploaded from a seperate application so the manipulation of video file is not possible. So is there any way to implement streaming without any change and play it in a video player other than using silverlight ?.
Is it possible to do anything if I can change the media file while uploading?
Thanks.
I have been doing almost exactly this, but without the Adaptive Streaming (I'm dealing with video files of only 25mb or smaller). I am using JWPlayer for the front end in my web page, and the video is in Azure blob storage.
I'm using the pre-built windows binary ffmpeg.exe I uploaded it to Azure (put it in root of Worker Role project), then I use System.Diagnostics.Process in a WorkerRole to massage the video files. You could do the same to create the different quality versions you want.
So, when a user uploads a video my business logic layer plops a message in an Azure message queue, my worker role picks it up, copies the video onto Azure LocalStorage (LocalStorage is physical disk you can configure in your Azure project settings file), runs ffmpeg.exe over the file and then puts it back in blob storage.
Related
I have few mp3 files stored on azure file storage. when try to play them in chrome browser with html audio tag, I see the audio stop playing after few mins. do I need to migrate them to azure blob storage for better streaming?
Yes, you would get better streaming support if you move your audio files to Azure Blob storage, and store them as blobs. Blob storage is designed for supporting streaming content. Read more about it here. Azure File storage is more for supporting migration scenarios, from on-prem to cloud, and to augment or replace file shares and servers.
does anyone know how we can upload to azure media service asset from a url without encoding?
the video stored on s3 amazon is in mp4 format and I don't need to encode it (it takes time), but I need to upload it to my azure media service and make it public for streaming on client side video players.
I use asp.net and azure media service sdk.
I've used Media Services before, and indeed indexed at time of upload. However, this blog seems to cover your scenario
https://blog.genreof.com/post/azure-media-services–indexing-existing-videos
How to download images and videos to local computer using the streaming manifest urls generated from Azure media services?
OR How should i convert streaming manifest urls to MP4 or other media formats?
If you encoded your content in Azure Media Services, they are already MP4 files in a container in Azure storage. You can list your assets, get the location in Azure Storage and then download the Mp4 files directly.
You can also request what is called a "progressive download" URL for your MP4 files, which allows you to download the MP4 files directly from the origin (so long as you have not blocked that with a content protection policy.)
See the Azure Media Services Explorer tool for an example of generating Progressive download URLs, and also an easy way to explore the Media Services account.
My goal is to allow a user to upload a video that isn't stored locally on disk. All of the examples I've seen for uploading a video to Azure media services show only files from the local disk being uploaded.
So i decided to try a method mentioned on Stackoverflow before, which is uploading a video firstly to Azure BLOB storage and then from here uploading the video to Azure media services.
So far I've successfully uploaded a video to Azure BLOB storage but I'm not sure on how to get this video to Azure media services.
Is there anyway of just passing the stored videos URI to Azure media services?
I've seen an example of copying an entire storage container to Azure Media services but I'd like to do it on a video by video basis.
Does anyine know of any decent tutorials that explain the steps?
The Asset entity contains digital files (including video, audio, images, thumbnail collections, text tracks and closed caption files) and the metadata about these files. After the digital files are uploaded into an asset, they could be used in the Media Services encoding and streaming workflows.
If I understand correctly, your question relates to how you would address an entity within Azure Media Services without the examples most tutorials use by reading a file from disk. As far as I understand the following line of C# would return an IAsset object that references a blob that is uploaded to Blob Storage.
IAsset inputAsset = UploadFile(#"C:\VideoFiles\BigBuckBunny.mp4", AssetCreationOptions.None);`
The result of this operation could also come from a users upload, you could implement this within your own Web Application. To access this video later on, you should store this AssetId. In your case you want to use the stored Asset ID in a way similar to this:
CloudMediaContext context = new CloudMediaContext("%accountName%","%accountKey%");
string sourceAssetId = "%sourceAssetId%";
IAsset sourceAsset = context.Assets.Where(a => a.Id == sourceAssetId).First();
Now, you have retrieved an Asset by it's AssetId from Azure Media Services. You can run encoding on it, or retrieve Publishing URL's for it.
Sources:
https://github.com/Azure/azure-sdk-for-media-services-extensions
https://azure.microsoft.com/en-us/documentation/articles/media-services-dotnet-get-started/#encode-the-source-file-into-a-set-of-adaptive-bitrate-mp4-files
What you are looking to do is create a new instance of an Azure Media Streamer, and when you do, simply have it point to your current Blob Storage account, and not have it create a new one.
By default, AMS will create a new blob storage account when you first upload a video to it.
I have a tutorial series on Azure Media Services.
I upload videos the same way that you do -- to my Blob storage account first, so that I can place them in a named container. Otherwise, when you just use AMS, it will create a container for you with random characters.
Let me know if you need any further detail.
Is there anyway of just passing the stored videos URI to Azure media services?
Yes. You have two choices here.
You can either:
Pass it as a file stream instead of a path string (there is an overload for that) OR
Create a blobtrigger
function/webjob which which creates an asset and encodes directly
from the blob when it is uploaded. https://learn.microsoft.com/en-us/azure/media-services/media-services-dotnet-how-to-use-azure-functions
I've seen an example of copying an entire storage container to Azure Media services but I'd like to do it on a video by video basis.
Yes, you can specify the blob within the container. See the "Create an Asset from a blob" section here https://github.com/Azure/azure-sdk-for-media-services-extensions
I am wondering if it is possible to host videos on the azure platform. Does Azure allow encoding videos using expression encoders before storing them as a blob. I am imaging a process/architecture where video is upload via client, saved to a location on azure and queued up. A process runs to pick it up from queue, encode it and save it as a blob. Any ideas will be helpful.
I do not think that there are services in azure today for video encoding. Could be a good business idea to write an app to do this.
You could load the video up to azure, then have another service that downloaded the video, encoded it, and sent it up to the cloud again. The major problem with this approach is the bandwidth cost that you would incurr.