Convert MP4 to ISM in Azure Storage - azure

I need to generate .ISM files from MP4 files that are uploaded to Azure BLOB storage. Probably as soon as the user uploads a MP4 file to BLOB storage I should be able to fire up a Azure Function that does the conversion.
Can someone please help me how to do the conversion from MP4 to .ISM.
Note: I do not want to use Azure Media Service, it is too expensive.

The .ism file probably won't help you much at all for this situation.
If you are trying to avoid using AMS completely and just do static packaging, you should generate HLS or DASH content directly into storage blobs. You could do that with FFMPEG or the Shaka Packager tool from existing Mp4 file. There are lots of OSS solutions out there that can generate static HLS and DASH content if that is your goal.
The .ism file is primarily a feature of AMS - and it provides the information that the Streaming Endpoint (origin server) needs to dynamically packaging on-the-fly from standard MP4 files to MPEG DASH, HLS, Smooth and add on the DRM encryption for Widevine, Fairplay, and Playready. If you have no need for the multi-format dynamic packaging from MP4, then AMS is probably not the right solution for your needs.
If you can share - what parts are too expensive for you? The encoding, the streaming endpoint monthly cost for (standard endpoint cost?) or is it the overall egress bandwidth needed to deliver content from Azure (which won't go away with a storage based solution and is normally 90% of the cost of streaming if you have popular stuff.)
If you are trying to avoid encoding costs, you can encode locally or in ffmpeg on a server vm at your own costs, and then upload and stream with AMS - I have a good sample of that here - https://github.com/Azure-Samples/media-services-v3-dotnet/tree/main/Streaming/StreamExistingMp4
Thanks,
John

Related

rtmp cdn to cloud streamer or free sreamer

I am new into RTMP and live streaming.
I have my rtmp server, but the issue is distribution, was looking for a simple rtpms streaming cdn. That can support audio streaming with HSL or dash support.
Or something free similar to youtube live, but for audio but with embeddable html.
Recently(2022.01) most of CDNs support only file-based streaming protocol, like HLS/DASH/CMAF, even you publish the stream by RTMP or WebRTC, the CDN also covert the stream to these protocols.
If you want to build low lagging live streaming application, like RTMP, HTTP-FLV is recommend and you need a CDN to support HTTP-FLV rather than RTMP. HTTP-FLV works well on PC or mobile, please read this post.
You could build your CDN by open-source media-server cluster, like SRS Edge to delivery HTTP-FLV, based on AWS EC2.
For CDN which support HTTP-FLV, you could check Tencent Cloud Streaming Services, which supports publish by RTMP, and deliver by HLS/HTTP-FLV/WebRTC.

which Azure Media Services V3 transform presets can I use to produce .webm output

I'm so far unable to identify a preset for an Azure Media Services V3 Transform that will encode a video into .webm format.
This tutorial explains how to create a custom transform preset, which would be helpful if I could identify the webm format like this one for mp4.
Is it possible that AMS simply doesn't support webm?
is this Azure Media Services and HTML5 Video really still the whole story?
AMS does not currently support WebM.
https://learn.microsoft.com/en-us/azure/media-services/latest/media-encoder-standard-formats
I'd be interested in any business justification for the requirement that you may have. We don't get a lot of customers asks for it (surprisingly).
WebM is not supported by Azure Media Services standard encoder. Output file format supported is just limited to MP4 and MPEG2-TS - see https://learn.microsoft.com/en-us/azure/media-services/latest/media-encoder-standard-formats for additional info.

Maximizing Encoding Speed with Windows Azure Media Service Encoding

I have an android application (client), asp.net web api web server (server), and Windows Azure Media Services (WAMS) account.
What I Want: To upload a 3-30 second video from the client to the server and have it encoded with WAMS then available for streaming via HLSv3 as quickly as possible. Ideally a video preview image would be generated as well. As fast as possible is something like sub one minute turn around. That's likely not realistic, I realize, but the faster the better.
Where I'm At: We upload the video to the server as a stream, which then stores it in Azure blob storage. The server returns to the client indicating upload success. The server has an action that kicks off the encoding which then get's called. I run a custom encoding task based off of the H264 Adaptive Bitrate MP4 Set 720p preset modified for taking a 640x480 video and cropping it to 480x480 at the same time as encoding. Then I run a thumbnail job that generates one thumbnail at 480x480. Depending on the reserved encoder quality this can take ~5 mins to ~2 mins. The encoding job time is only 30-60 seconds of that and the rest is a mix of queue time, publishing time, and communication delay.
What can I do to improve the client upload to video streamable turn around time? Where are the bottle necks in the encoding process? Is there a reasonable max speed that can be achieved? Are there config settings that can be tweaked to improve the process performance?
Reduce the number of jobs
The first thing that springs to mind is given you're only interested in a single thumbnail, you should be able to consolidate your encode and thumbnail jobs by adding something like this to the MediaFile element of your encode preset:
<MediaFile ThumbnailTime="00:00:00"
ThumbnailMode="BestFrame"
ThumbnailJpegCompression="75"
ThumbnailCodec="Jpeg"
ThumbnailSize="480, 480"
ThumbnailEmbed="False">
The thumbnail will end up in the output asset along with your video streams.
Reduce the number of presets in the task
Another thing to consider is that the preset that you linked to has multiple presets defined within it in order to produce audio streams at different bitrates. My current understanding is that each of these presets is processed sequentially by the encode unit.
The first preset defines the video streams, and also specifies that each video stream should have the audio muxed in at 96kbps. This means that your video files will be larger than they probably need to be, and some time will be taken up in the muxing process.
The second and third presets just define the audio streams to output - these wouldn't contain any video. The first of these outputs the audio at 96kbps, the second at 56kbps.
Assuming you're happy with a fixed audio quality of 96kbps, I would suggest removing the audio from the video streams and the last of the audio streams (56kbps) - that would save the same audio stream being encoded twice, and audio being muxed in with the video. (Given what I can tell from your usage, you probably don't need that anyway)
The side benefit of this would be that your encoder output file size will go down marginally, and hence the cost of encodes will too.
Workflow optimisation
The only other point I would is regarding the workflow by which you get your video files into Azure in the first place. You say that you're uploading them into blob storage - I assume that you're subsequently copying them into an AMS asset so they can be configured as inputs for the job. If that's right, you may save a bit of time by uploading directly into an asset.
Hope that helps, and good luck!

mp4 streaming problems using azure blob storage

I uploaded a mp4 test video to azure blob storage. But the video performance is too slow and takes a while to start streaming.
Is there anything that can be done to improve performance?
The video size is ~ 49MB
http://dzcdn.blob.core.windows.net/dz-cdn-blob/jiju.mp4
Azure Blob Storage does not support streaming it only supports Progressive Download. It is good to have understanding of these. Because it is Progressive download, the player needs to initially fetch some amount of data before start playing it. Although Progressive Streaming, I haven't seen any problems with playing media out of Blob Storage so far (just for the record - the provided video started in just 4 seconds with super quality).
But if you want to cover wider audience, potentiality with slower internet connection, you might want to go and check Azure Media Services. Media Services supports wide range of streaming features including Smooth Streaming, Fixed bitrate streaming, progressive download, Apple HTTP Adaptive streaming (Apple HLS Streaming) etc. And smooth streaming will help with slower connections, while keep the better quality on faster ones.

Creating and Streaming a composite manifest file in Windows Azure

I'm currenly developing an application using Windows Azure Media Services for video processing.
The scenario is: a user manages a sequence of video clips, puts them in a specific order and submits them to Media Services for processing.
I managed to stream the clips individually using they're *.ism/manifest url generated by Azure Media Services, but I want to stream them as a single clip.
I understand Azure Media Services does not provide merging/stitching capability for now, so the alternative is to use a composite streaming manifest file (*.csm) and reference the path of all the individual clips there.
The problems I run into are:
I could not find a single playable *.csm file on the internet as a reference
I used this tool http://code.msdn.microsoft.com/wpapps/Smooth-Streaming-Manifest-b1c3c9f9/view/SourceCode to generate a .csm based on an existing/playable ism/manifest, but I don't know how to play it.
The ism streaming url is something like:
http://.origin.mediaservices.windows.net/dd754ce8-3de8-457f-9e57-380723794e66/clipName.ism/Manifest
and is stored in Media Services and the actual files .ism and .ismv files are stored in a storage container like asset-1707d318-0484-4f8c-8f66-890786ccb1e3
Where should I store the *.csm file in Azure? Is there any running .csm player with samples available so I can test my generated .csm?
Thanks,
Florin
You can use azure storage container for storing CSM file and for testing any CSM file you can use SMF health monitor http://smf.cloudapp.net/healthmonitor.

Resources