Latency parameters ignored

May 14, 2012 at 6:26 AM

Hello:

Created a 2.6.1 project with the latest 1.5 smooth client and am having it play back live content.  Have been attempting to reduce latency down from the default 18s value to something under 10 seconds.

Have managed to figure out how to create a custom control in the player and set/verify liveplaybackoffset, livebackoff, and bufferingtime SmoothStreamingMediaElement values at 1 second, but it does not have any impact whatsoever on actual end to end latency when running the app.

Can someone confirm this is correct, and shed some insight on why it has no overall effect on SSME's actual playback latency?

Thanks in advance.

namespace SMF_SmoothStreaming1
{
    public class CustomPlayer : SMFPlayer
    {
        protected override void OnMediaOpened()
        {
            base.OnMediaOpened();

            SmoothStreamingMediaElement ssme = ActiveMediaPlugin.VisualElement as SmoothStreamingMediaElement;

            if (ssme != null)
            {
                TimeSpan smallOffset = new TimeSpan(0, 0, 1);
                ssme.LivePlaybackOffset = smallOffset;
                ssme.LiveBackOff = smallOffset;
                ssme.BufferingTime = smallOffset;

            }
        }
    }
}

May 15, 2012 at 11:15 AM

Hi

I am not sure BufferingTime actually does much for this scenario. I would remind you that there is also a serverside setting on how many segments it should keep (i believe this defaults to 2). Also, you might wan't to look into low latency smooth streaming if your encoder supports it. As i understand it, LLSS allows the encoder to send incomplete segments to help with bufferbloat.

- Loke

May 15, 2012 at 1:24 PM

Thanks,  Loke:

Yeah, we've set lookahead fragments to 1 in IISMS.

I've looked high and low for any documentation on LLSS.  There appears to be none on how to actually implement, save setting the above values which don't appear to actually have any effect in SMF (at least in the way I've implemented them.)

Envivio has been kind enough to provide us with a unit for proof of concept, and has configured their encoder and our IISMS the way it's meant to be done, but we're having difficulty locating any information on how to actually build a Silverlight player that demonstrates any latency below 17-20s or evidence that one exists in the wild today.  All that seems to exist on the internet is few short snippets that accompanied the Smooth Client 1.5 release claiming that it's now possible, and referencing the above values which don't appear to work via SMF.

We've raised the issue with MS top brass @ silverlight and envivio.  I'll report back with any findings in the hopes it'll help someone else down the road.

Coordinator
Jun 1, 2012 at 11:09 PM

The SSME docs say you need to set the offset props before SSME.SmoothStreamingSource is set.

>>Changes that are made to this value after the SmoothStreamingSource property has been set are disregarded.<<

This is somewhat of a challenge because there are not many opportunities to do this since the SSME is created as it is needed. However, here's a back door of sorts that will give you the timing you need:

public SmoothStreaming()
{
    InitializeComponent();
    smf.MediaPluginRegistered += smf_MediaPluginRegistered;
}

void smf_MediaPluginRegistered(object sender, Core.CustomEventArgs<Plugins.IMediaPlugin> e)
{
    e.Value.PluginLoaded += Value_PluginLoaded;
}

void Value_PluginLoaded(IPlugin obj)
{
    obj.PluginLoaded -= Value_PluginLoaded;
    var mediaPlugin = obj as IMediaPlugin;
    if (mediaPlugin == null) return;
    var ssme = mediaPlugin.VisualElement as SmoothStreamingMediaElement;
    if (ssme == null) return;
    TimeSpan smallOffset = new TimeSpan(0, 0, 1);
    ssme.LivePlaybackOffset = smallOffset;
    ssme.LiveBackOff = smallOffset;
    ssme.BufferingTime = smallOffset;
}

 


Jan 19, 2014 at 6:49 PM
There is a simpler way to do this:
public class MyPlayer : Microsoft.SilverlightMediaFramework.Core.SMFPlayer
{
    protected override void OnMediaPluginLoaded()
    {
        ((SmoothStreamingMediaElement)ActiveMediaPlugin.VisualElement).BufferingTime = new TimeSpan(0);
        ((SmoothStreamingMediaElement)ActiveMediaPlugin.VisualElement).LiveBackOff = new TimeSpan(0);
        ((SmoothStreamingMediaElement)ActiveMediaPlugin.VisualElement).LivePlaybackOffset = new TimeSpan(0);

        base.OnMediaPluginLoaded();
    }
}