none
Random 404 not found errors on OnDemandOrigin locator url RRS feed

  • Question

  • We are using smooth streaming to deliver video content and using smooth streaming plugin for adobe strobe media player to watch video.

    We tried to watch video on two different machines connected to internet from different networks, the manifest url generated was same. On one machine we were able to play video while on other machine we got error playing video. When checked on chrome developer tools network tab, it show 404 error for manifest. 

    We also observed this behavior happens randomly, sometimes the video is played and sometimes we get error, but manifest url is same.

    Here is our code to generate smooth streaming url:

    public Uri GetSmoothStreamingUri(IAsset assetToStream, TimeSpan duration)
    {
        //
        // Find the .ism in the asset
    	//IFileInfo ismFile = (from f in assetToStream.Files
    	var ismFile = (from f in assetToStream.AssetFiles
    			where f.Name.EndsWith(".ism")
    			select f).FirstOrDefault();
    
        if (ismFile == null)
            throw new ApplicationException("Could not find a .ism file in the asset.id: " + assetToStream.Id);
    
        Uri smoothUri = null;
    
        //
        // Look for an existing locator
        ILocator locator = null;
        var locators = (from rows in assetToStream.Locators where rows.Type == LocatorType.OnDemandOrigin orderby rows.ExpirationDateTime select rows).ToList();
        if (locators != null && locators.Count() > 0)
        {
            //Get the one that expires last:
            locator = locators.LastOrDefault();
        }
    
        //
        // Check the existing locator
        //
        if (locator != null)
        {
            if (locator.ExpirationDateTime <= DateTime.UtcNow + TimeSpan.FromHours(2) /* double of maximum length of video */)
            {
                //Force the locator to be recrated
                locator = null;
    
                //Make sure there will be a locator slot available:
                //If there are already maxLocators, then revoke the earliest
                var extraLocatorsCount = Math.Max(0, locators.Count() - Constants.MaxLocators /* 5 */) + 1;
                for (int i = 0; i < extraLocatorsCount; i++)
                {
                    var earliest = locators[i];
                    if (earliest != null)
                    {
                        //mediaContext.Locators.Revoke(earliest);
    					earliest.Delete();
                    }
                }
            }
        }
    
        //
        // Create a locator if required.
        if (locator == null)
        { 
            IAccessPolicy streamingPolicy = mediaContext.AccessPolicies.Create("Streaming policy", duration, AccessPermissions.Read);
            var startTime = DateTime.UtcNow.AddMinutes(-15); //15.Minutes().Before(DateTime.UtcNow);
            //locator = mediaContext.Locators.CreateOriginLocator(assetToStream, streamingPolicy, startTime);
    		locator = mediaContext.Locators.CreateLocator(LocatorType.OnDemandOrigin, assetToStream, streamingPolicy, startTime);
        }
    
        //
        // Build Uri
        if (locator != null)
        {
            UriBuilder builder = new UriBuilder(locator.Path);
            builder.Path += ismFile.Name + "/manifest";
            smoothUri = builder.Uri;
        }
    
        return smoothUri;
    }


    Thanks.


    • Edited by bcodev Tuesday, March 26, 2013 7:10 AM
    Tuesday, March 26, 2013 7:09 AM

Answers

All replies

  • Can you please provide the following data so that we can help debug this?

    1) What region is your Media Services account in?

    2) Are you using On-Demand Streaming Reserved Units?

    3) What is the URL to your content?

    Wednesday, March 27, 2013 4:29 PM
    1. Our media services region is West US.
    2. We are not using On-Demand Streaming Reserved Units.
    3. We are experiencing this issue to all the videos we have uploaded (currently 3). Here is a link to one of the locator

    http://coursico.origin.mediaservices.windows.net/2661551f-2f61-498c-ab78-5ced736df70c/Lets-get-started-with-Implants-720p.ism/manifest

    Note that locator exists for 24 hours.


    • Edited by bcodev Thursday, March 28, 2013 6:28 AM
    Thursday, March 28, 2013 6:22 AM
  • Thank you

    We are looking in to it

    Thursday, March 28, 2013 7:39 PM
  • We haven't been able to repro the issue. As you aren't using any on-demand streaming reserved units, streaming capabilities come from a shared pool of machines that doesn't have an SLA associated with it. The on-demand streaming SLA is only associated with use of reserved units. You should be aware that your usage of the shared pool can be impacted by other customers usage as we don't currently throttle any usage between customers. So if you need high reliability for on-demand streaming I would recommend usage of reserved units. That said to investigate a bit further we need answers on the following:

    • What client are you using for playback in Chrome?
    • Are you only able to repro this issue on one of your machines? You indicated that you tried on two different networks. What is different about these networks.
    • Please provide us the time (with time zone) when you are able to repro this issue.
    Thursday, March 28, 2013 11:17 PM
    Moderator
  • Also, we have setup a test page with video at http://bit.ly/155c2fR.

    Thursday, April 11, 2013 7:17 AM
  • Can you please update the plugin to latest version (1.0.3) and have a try? If you still have issues after the upgrade, can you also provide a http dump (e.g. using fiddler) that shows the 404?

    Thanks,

    Cenk

    Thursday, April 11, 2013 6:15 PM
    Moderator
  • Two months without reply.  Closing the thread.
    Monday, June 10, 2013 10:52 PM