Azure media service vs regular file storage for processing videos - azure

What should I use from Azure for an application where I am uploading videos and I want to process videos to obtain information with my own worker roles but I dont want to stream the videos. Should I use Media service or regular blob storage?

#Devsined, per my experience, my suggestion is that uploading & processing videos to & from blob storage is the better choice to obtain information. Even I think, if having Azure App services consideration, you can upload videos into queue storage first, then to store into blob storage, and using webjobs to handle the vedio from queue and record the obtained inforamtion to Azure Database.
Any concern, please feel free to let me know.

Related

Best way to upload medium sized videos to azure blob storage?

I am currently on a student plan for azure (gotta stay finessing as a college student lol) and am looking for the best way to upload videos to azure blob storage. Currently, I am using an azure function api to upload the video, but I am encountering a "Javascript heap out of memory" error when I try and multiparts parse big video files.
Ideally, I'd be able to quickly upload 3.5 minute music videos from mobile and desktop to azure blob storage with this method.
Either a better way of uploading videos to blob storage from my front-end or a solution for the javascript heap out of memory error would be amazing help.
Here's the link to that other post, if you are curious: How to fix JavaScript heap out of memory on multipart.Parse() for azure function api
Approaches:
After a workaround based on your issue, I would suggest that you use Azure Media Services.
Media Services can be integrated with Azure CDN. Refer to check Media Services-Managing streaming endpoints.
All supported formats use HTTP to transport data and benefit from HTTP caching. In live streaming, actual video/audio data is separated into fragments, which are cached in CDNs.
To start, I recommend that you use the Azure Storage SDK with Node.JS. The SDK will handle everything for you. Attaching few uploaders below to check accordingly.
Upload a video to Azure Blob examples
Refer MSDoc & SO thread by #Gopi for uploading a video with the .mp4 extension to Azure blob storage using C#.
You can upload a video using Azure functions directly. But to use Azure Functions, you must create a back-end component written in.NET, Java, JavaScript, or Python.
You can use the "Azure Storage Rest API" to upload files/video files using a storage account, like you mentioned. You will be able to get the desired result by using this Azure Storage Rest -API-MSDoc.

audio stop playing after few mins hosted on azure file storage

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.

Azure Blob Storage Videos

I'm creating a xamarin forms app with Azure and I want it to use large images and videos.
I already know how to make it work with images (Blob Storage and Azure functions) but I have no idea with videos.
I mean if an user upload a 4K video into my blob storage, it has to be compressed (probably before being send to the blob storage). I don't know where to start - I've seen Blob storage encoding, Media services and CDN but I don't know if it's the right path. Can someone enlighten me on that matter?

Cut videos from Azure Blob Storage

I have a web app that is hosted in Azure; one of it's functionalities is to be able to make a few cuts from the video(generate 2 or 3 small videos of 5-10 seconds from a larger video).
The videos are persisted in Azure Blob Storage.
How do you suggest to accomplish this in the Azure environment?
The actual cutting of the videos will be initiated by a web job. I'm also concerned about the pricing(within the Azure environment), I'm taking into account the possibility of high traffic.
Any feedback is appreciated.
Thank you.
Assuming you have video-cutting code that operates on files through normal I/O: You'd need to download the video file from blob, process it via code (or whatever library you've employed), and then store the result back in blob storage. You cannot reference a blob directly with normal standard IO libraries.
If, however, videos are stored in Azure File storage (which is an SMB layer on top of blob storage, then you will be able to directly manipulate your video files.
Web Jobs run within an App Service (just like Web Apps), so you have access to a certain amount of local disk space (depending on App Service tier) for use. You should have no problem temporarily storing a video file within your web app's disk space, for editing operations.
You asked about cost: Again, assuming you're talking about running code within a Web Job (app service), you're just paying for whatever App Service tier you've chosen.
How you actually do those edit operations is entirely up to you (language, library, etc).
Azure Blob Storage is simply an object store which stores the data. It does not have the capability you're looking for.
Azure Media Service however is the service you should look into. The media served by this service makes use of Azure Blob Storage.
For editing video, may I suggest you take a look at Video Editor Plugin for Azure Media Player. You can read more about this plugin here: https://azure.microsoft.com/en-in/blog/video-editor-plugin/. You can also try it out here: http://ampdemo.azureedge.net/amp_editor.html.

upload video from azure blob to azure media services

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

Resources