IIS Smooth streaming low quality on startup

I host several adaptive video streaming on windows azure, and I noticed that at the beginning of the video, it starts with the lowest bit rate available. This is a big problem.

I saw while browsing the Internet that a trick can be done by connecting a manifestready event and deleting the lowest bitrates, and then adding them back after a while. This makes sense, but I have not seen sample code for this.

I got the player code from expression encoder 4 and looked, but could not find where to do it.

Does anyone have more information on improving startup for smooth streaming?

Many thanks

+7
source share
4 answers

Hi, I posted a question on the Media Platform Player forum and got an answer that works.

Discussion here: http://smf.codeplex.com/discussions/271042

Here is the code I'm using:

public MainPage() { InitializeComponent(); player.MediaPluginRegistered += new EventHandler<CustomEventArgs<IMediaPlugin>>(player_MediaPluginRegistered); player.PlayStateChanged += new EventHandler<CustomEventArgs<MediaPluginState>>(Player_PlayStateChanged); } private IAdaptiveMediaPlugin _adaptivePlugin = null; private bool isStartupHeuristicsActive = false; void player_MediaPluginRegistered(object sender, CustomEventArgs<IMediaPlugin> e) { var adaptivePlugin = e.Value as IAdaptiveMediaPlugin; if (adaptivePlugin == null) return; if (_adaptivePlugin == null) _adaptivePlugin = adaptivePlugin; _adaptivePlugin.ManifestReady +=new Action<IAdaptiveMediaPlugin>(_adaptivePlugin_ManifestReady); } void _adaptivePlugin_ManifestReady(IAdaptiveMediaPlugin obj) { if (_adaptivePlugin != null) { var videoStream = _adaptivePlugin.CurrentSegment.SelectedStreams.Where(i => i.Type == StreamType.Video).FirstOrDefault(); if (videoStream != null) { var averageBitrate = videoStream.AvailableTracks.Average(t => t.Bitrate); var track = videoStream.AvailableTracks.FirstOrDefault(t => t.Bitrate >= averageBitrate); if (track != null) { isStartupHeuristicsActive = true; videoStream.SetSelectedTracks(new[] { track }); } } } } private void Player_PlayStateChanged(object sender, CustomEventArgs<MediaPluginState> e) { if (isStartupHeuristicsActive && e.Value == MediaPluginState.Playing) { isStartupHeuristicsActive = false; if (_adaptivePlugin != null) { var videoStream = _adaptivePlugin.CurrentSegment.SelectedStreams.Where(i => i.Type == StreamType.Video).FirstOrDefault(); if (videoStream != null) { videoStream.SetSelectedTracks(videoStream.AvailableTracks); } } } } 

thanks

+7
source

As mentioned in another mention, use MMPPF (formerly Silverlight Media Framework). A much more full-featured player and relatively easy to configure (with video tutorials, too).

For bitrate - yes, the Smooth Streaming algorithm is designed to minimize delays - so the lowest bit / bit is used at startup. However, you can do what you want.

You will need to do 2 things first:

Add a handler to the OnMediaPluginRegistered player OnMediaPluginRegistered . In this case, check if it is IAdaptiveMediaPlugin - you will need an instance of this plugin. Here's a sample ...

  IAdaptiveMediaPlugin _adaptivePlugin = null; void OnMediaPluginRegistered(object sender, Microsoft.SilverlightMediaFramework.Core.CustomEventArgs<Microsoft.SilverlightMediaFramework.Plugins.IMediaPlugin> e) { var adaptivePlugin = e.Value as IAdaptiveMediaPlugin; if (adaptivePlugin == null) { return; } if (_adaptivePlugin == null) { _adaptivePlugin = adaptivePlugin; } } 

Once you do this, wait until one of the events is open for media events (MediaOpened or something else), you will now have access to the method on IAdaptiveMediaPlugin , which is called SetVideoBitrateRange(...) .

For example:

 _adaptivePlugin.SetVideoBitrateRange(minBitrate, maxBitrate, true); 

This should give you what you need.

+4
source

Try using the Microsoft Media Platform: Player Framework instead of Expression Encoder Player - it has more advanced logic.

0
source

you can delete additional streams (low-quality) on the server side manually (you need to edit the xml files there, and not just delete the physical stream files) or use IIS, which provides the ability to edit smooth streams (provided that you have installed the corresponding extension, say, through Microsoft Platform Installation Application). You can also use WinMerge or a similar tool to compare a copy of the clip folder that you saved before using the MS tool to find out what it changed when you delete a specific (optional) stream from a smooth stream (compare the previous and new version .ism *) .

which is also a useful reason, sometimes the player underestimates the client processor and bandwidth (there are some user versions that should fix the processor heuristic error by editing some configuration file beforehand). That is, if you have any screencast, sometimes the client does not receive a stream of sufficient quality to read the text, so you need to delete the lower (sub) streams, and then it works fine (you start to delete the lower ones and see, after which one shows OK). You can also customize the TransformManager (or your code that invokes the corresponding functionality) to not create low quality versions

0
source

All Articles