AWS Cloudfront Video Streaming - Video Quality Change - flutter

I am developing an Video-on-demand mobile application. Videos are converted using AWS Elastic media converter and stored in S3 bucket. It will be streamed using Cloudfront.
The problem I'm facing is to stream the video on different quality(720p,360p..)
If user has less data then they wish to watch video in low quality. So how to change the video quality manually ?

You can combine the solution with Lambda#Edge and request the video resolution via GET parameters in this manner (copied from AWS Blog):
Read More here .

As you stated that you need multiple resolution videos so user can switch the quality based on their internet connection and you are using AWS media convert.
You need to convert the multiple resolution videos first using the trascoding services that you are using AWS then need to pass these multiple resolution files on media player so it will show the quality section features.let me know if you need more clarification or help on that.

Related

Azure media player source manifist

We are very small junior school private tutors have setup of an online portal where students can login and watch the daily video lectures. We have many videos uploaded to Azure media services but we realized the encoding cost is high and not affordable. So I encoded a video using FFMPEG and generated m4s and audio file and .mpd (metadata) using MPBox in my local.
I have copied all the files on Azure blob storage and blob storage have HTTPS access. Can I use .mpd as source url for Azure media player ?
e.g. Azure media player source is //amssamples.streaming.mediaservices.windows.net/3b970ae0-39d5-44bd-b3a3-3136143d6435/AzureMediaServicesPromo.ism/manifest
but my generated metadata from MPDBox is
https://bb.sourceoftraining.companywebinternet.storage/ssj-ewrrer-2343s-ssssdf23/process_and_benifits.mpd
Or any other player I can use. I tried Shaka player but unable to show the Resolution and Playback speed settings.
Uploading pre-encoded MP4's works just fine. I suggest you download the latest version of the Azure Media Explorer tool for the v3 API. In there you can now upload an MP4 into a new asset, and have it generate the client and server manifests needed for streaming. Just upload to a new empty Asset, and then double click on the asset to get to the tab for the files, and click the generate manifests buttons.
That pre-gens the required manifest files needed for streaming an MP4 that is pre-encoded with closed 2 second GOPs. The tool pre-generates both the client and server manifest and saves them back into the asset to improve the playback performance from the streaming server.
You can use Azure Media Player to play back DASH, Smooth, or HLS - but the technology that it chooses to use for playback differs by platform. For example depending on the browser version, OS, or mobile client it will chose to load a different player tech or it will use the built-in OS player support.
https://learn.microsoft.com/en-us/azure/media-services/azure-media-player/azure-media-player-overview
For DASH content (.mpd) the AMP player chooses to use Dash on Windows, and on Android in specific conditions. It does this by detecting the platform and using the right tech combined with the /manifest(format=mpd-time-cmaf) format on the URL. You can learn more about how "dynamic packaging" works in AMS here - https://learn.microsoft.com/en-us/azure/media-services/latest/dynamic-packaging-overview
There are various "format" options on the streaming locator URL in AMS that provide different manifest formats back.
Smooth Streaming = /manifest
MPEG-DASH-CMAF = /manifest(format=mpd-time-cmaf)
HLS with CMAF = manifest(format=m3u8-cmaf)
HLS v3 (TS) = /manifest(format=m3u8-aapl-v3)
Using one of those various formats, you can use any 3rd party player that supports them. Shaka, HLS.js, Exoplayer on Android, iOS AvFoundation native player, Video.js, or even the 'adpater-player' noted by Jason above. Any player that supports the current HLS or DASH specifications should work.
If you have School email addresses that you can use for yourself and your students the simplest solution would be to leverage capabilities from Microsoft Stream via the free O365 education plan - https://www.microsoft.com/en-us/microsoft-365/academic/compare-office-365-education-plans. Info on Microsoft Stream at https://www.microsoft.com/en-us/microsoft-365/microsoft-stream.
And to clarify feedback Jason Pan just provided, while Azure Media Player doesn't support just pointing at .mpd file for playback this is rather done via first creating appropriate server manifest and then requesting .mpd manifest via format option in the URL clients will use to request content. Media Services will then dynamically create the appropriate manifest to respond to the client request. See John's response for links to articles with additional feedback on this.
If you use Shaka Player's UI library, you'll be able to display the Resolution and Playback speed settings.
Shaka UI library Shaka Player Demo

Encoding of audio (mp3, mp4, m4a, ogg) file for smooth streaming window media services

I want to encode the audio file (mp3, mp4, m4a, ogg) for the streaming and want to play (I want to play encoded file smoothly) using the HTML5 player but I think HTML5 player.
So now what I am doing, I am uplaoding a file and econding this file on windows Azure Media Services using the preset "AAC Good Quality Audio". It encode the file with .mp4 file format and then I create SAS locator to run this file, it works well but the problem is that user can download it too which I don't want to allow.
If I create the OnDemandOrigin locator of the same encoded asset, it gives me 404 erroe. It means we can not play it.
Below are the steps that I have used to upload the file on Azure Media Services:
Created the empty assest.
Upload the file into the asset.
Then create the new task job to encode the audio file.
I have successfully encoded the file but when I try to generate the origin url it generate the url but when I browse the file I get
the error 404.
My queries:
"AAC Good Quality Audio" preset is the right for my task?
How can I restrict the user to download the file, if I use sas locator.
Is it possible to play the encoded file using origin locator.
Can I encode audio files for smooth streaming ? If I can then which player I should use to run the encoded file for all browsers, IOS devices and android devices.
If you want further details please feel free to ask me.
Awaiting your response.
Thanks
If your user is able to listen to the audio you're publishing, they will also be able to download the file. This you can not prevent. At best, you can make it difficult, but not impossible. More to the point, Media Services at its current incarnation has no way for you to do authorization of any kind, so the only tool you've got is time-bombed SAS locators.
The typical solution for this problem is to use DRM. Media Services supports PlayReady encryption, but you need to either have a PlayReady server or purchase it as a service (there is currently a service in the Azure Marketplace that provides PlayReady for a monthly price).
See following article how to protect assets with Microsoft PlayReady technology
Origin Locators are something you would use to publish a Smooth Stream or HLS asset. It is not useful for regular media files, as it is internally something equivalent to an IIS Media Services endpoint. For regular media files, you can just as well host them in Blob Storage -- and refer to them via the SAS locator.
There is currently no single format that will play across all devices and operating systems. You can get Smooth Streaming to work on most Windows and Mac computers (possibly Linux, too), either with Silverlight or with the Smooth Streaming Plugin for the Flash-based OSMF. For iOS devices you will need to encode to HLS and use the HTML5 video tag. Microsoft Media Platform will support MPEG-DASH, a recently ratified ISO/IEC standard for dynamic adaptive streaming over HTTP.More details how to use DASH preview feature can be found here
If you want smooth streaming for audio only, it looks like you will have to create a video asset with an empty video stream -- although there is a Uservoice request to add support for audio only in the future.

Streaming video, cloud servers, and videojs

I'm interested in setting up a streaming video server (perhaps on a cloudfront server) with videojs. I understand that flash video can be streamed, however, is it possible to stream video using videojs and a different codec? (like h246). I tried looking through the videojs documentation and forums but did not find any additional info.
Video.js has limited support for RTMP streaming in Flash, but hopefully more in the next few months.
HTTP Live Streaming (HLS) is the most supported streaming format for HTML5 (iOS, Safari, latest Android). Video.js can support that on the devices that support HLS natively.
I think you would have to transcode the h264 file on the fly to get the effect you want. Subsonic is a program which will read your file structure, display your videos and music in a webui, transcode the audio/video and stream it--but it uses jwplayer, not videojs.
However, it is opensource, so if you want to try to modify that, I'm sure it would be possible.

iPhone MPMoviePlayerController : download files while streaming en play them locally

I've m3u8 file with all the TS files. MPMoviePlayerController play them fine via http request on the streaming server. But I'd like to get the files locally in order to play them again later without any connection.
I managed to download m3u8 file and all the TS files locally on my device, I edited m3u8 files to point to local .ts instead of http ones, but I can't read them from this emplacement.
(VLC can do it well)
Is there a way to download the segments while playing (to avoid 2 downloads) and then to play them locally with MPMoviePlayerController or else.
.m3u8 is Apple HTTP Live Streaming, right? I think what you're trying to do simply goes against the design of that technology. You should expose the original file and allow it to be downloaded.
From what I understand, it's in the design of streaming that you don't get explicit access to the pieces in order to put them back together. For instance, Netflix uses streaming via Silverlight, and one of the benefits (to Netflix) is that it protects the data from being saved as if it were downloaded. Also, since HTTP Live Streaming allows a stream to switch bitrates on the fly, it's designed such that each time slice can be encoded at any number of bitrates, and none of them is canonical.
In theory, there might be a way to collect all the slices for a particular bitrate and re-encode them into a single video. But Apple's playback APIs are not going to give you that opportunity.
Instead of HTTP Live Streaming, consider progressive download. Just serve the original video file (transcode it to something the iPhone likes if necessary). If your server is configured properly, the playback APIs will do small requests to get particular chunks of the file, rather than the whole thing in one go, and it's a close second to proper streaming. I wish I could find where I read about this so I could give the proper name for it. Amazon S3 is set up to serve this way, if you need a quick solution.
But beware, Apple's docs say,
If your app delivers video over
cellular networks, and the video
exceeds either 10 minutes duration or
5 MB of data in a five minute period,
you are required to use HTTP Live
Streaming. (Progressive download may
be used for smaller clips.)

Mac/iPhone:Streaming video file to iPhone

I have a http streaming link which gives me .flv streaming feed. I want to convert that and access in my iPhone program. How can i do that? I want to have a desktop software like VLC and input this streaming feed URL and convert to iPhone supported and stream again to iPhone. I tried VLC with H.264 and Mpeg-1 audio, but seems to be it doesn't give the supported format, so as iPhone program doesn't play the video.
Could someone please guide me how can i setup a desktop software which can stream iPhone supported file?
Thanks in advance.
I think even the great VLC can't convert FLV on the fly...(or even do anything with FLV). As far as streaming goes, you'll probably be limited to the local network (Wi-Fi). I'd start with the simple way—create an ad-hoc file server on the desktop, then use AVPlayer's initWithURL method to find that video.
On the desktop, you could query the IP address of the computer, and ask the user to enter that URL (along with an optional port assignment and file component, like http://192.168.0.2:2234/streamingVideo.mp4) onto the iDevice, then convert to NSURL.
What exactly is the http streaming link? This matters a lot as in order to stream to the iPhone you need to use HTTP Live Streaming which requires some different bits than a typical flash media, or more properly RTMP, server. Typically you need two different streaming architectures or some expensive boxes.