"A fragment is too long" errors when encoding MP4 to SmoothStream RRS feed

  • Question

  • Hi,

    I've been testing an encoding job with about 120 wmv files or varying durations, and am getting a lot of errors stating "A fragment is too long, possibly because a subset of the input tracks is not aligned".

    I am using a job with two tasks, the code is shown below:

    public void EncodeWebcast(string assetId)
        // Get the asset to be encoded
        IAsset asset = GetAssetById(assetId);
        string jobName = "Encode - " + asset.Name;
        // Create a job
        IJob job = m_CloudMediaContext.Jobs.Create("Encode - " + asset.Name);
        // Create a task to encode to MP4
        IMediaProcessor mp4Processor = GetMediaProcessor("Windows Azure Media Encoder");
        ITask task1 = job.Tasks.AddNew
            ("WmvToMP4", mp4Processor, "H.264 256k DSL CBR", TaskCreationOptions.None);
        task1.OutputMediaAssets.AddNew("FooBarAsset1", true, AssetCreationOptions.None);
        // Create a task to encode to smooth stream
        IMediaProcessor smoothStreamProcessor = GetMediaProcessor("MP4 to Smooth Streams Task");
        string smoothStreamConfiguration = File.ReadAllText(Path.Combine(MediaProcessorConsole.MediaPath, "MP4 to Smooth Streams.xml"));
        ITask task2 = job.Tasks.AddNew("My Mp4 to Smooth Task", smoothStreamProcessor, smoothStreamConfiguration, TaskCreationOptions.None);
        task2.OutputMediaAssets.AddNew("FooBarAsset2", true, AssetCreationOptions.None);

    The task that fails is always the second task (My Mp4 to Smooth Task), which implies that there is a problem with the MP4 file created by the first task.

    Has anyone else seen this? I'll do some more troubleshooting and relpy if I figur out what is causing it...



    http://www.CloudCasts.net - Community Webcasts Powered by Azure

    Wednesday, August 1, 2012 5:40 PM


All replies

  • Do you see a similar issue if you convert directly from a WMV to a Smooth Streaming video?
    Thursday, August 2, 2012 2:29 PM
  • Also try a different profile for the first encode.  For example, try the "H.264 High Speed Broadband CBR" profile for the WMV -> MP4 conversion.  I think some of the profiles may not create a GOP aligned MP4.
    Thursday, August 2, 2012 2:41 PM
  • Hi David,

    I am having the same error i.e "A fragment is too long", but in my case I already have the original content as MP4.   

    I have found that on the IIS media forum, few users had similar issues and they were able to resolve by using  "... set KeyFrame Min and Max distinance to 2 seconds per framerate. Something like "–keyint 48 –min-keyint 48" (or 50)"


    So I was wondering if we could somehow specify these setting in the MediaPackager_MP4ToSmooth.xml (http://msdn.microsoft.com/en-us/library/windowsazure/hh973635.aspx).



    Monday, April 8, 2013 9:54 AM