• Common mistakes / issues when creating and using Composite Stream Manifests (.CSM)

    Published by on February 5th, 2010 6:39 pm under Adaptive Streaming, Composite Stream Manifest, CSM, Emerging Technology, IIS7, Live Smooth Streaming, Media, RCE, Rough Cut Editing, Smooth Streaming, Smooth Streaming Media Element, Smooth Streaming Player Development Kit, SSME


    One of the greatest features added on the Beta 2 version of the IIS Smooth Streaming Player Development Kit (SSPDK) is the support for Composite Stream Manifests for Rough Cut Editing. This a powerful feature which I really recommend looking at, and if you want to learn the basics of the CSMs you must take a look at the following posts:

    I’ve been working with CSMs for three months now, so in this post I would like to share with you the lessons I’ve learnt during the process of creation and usage of the CSMs.

    There are a few common mistakes and issues you might face during that process, so I hope this post will be helpful for the community. 


    Configure IIS to serve .CSM files

    In order to do that, you have to add a mime type entry on IIS for the .CSM extension on every IIS server that is serving up the .csm files. The mime type for the .csm must be “text/xml”. You can do this on the IIS Manager. Also you can achieve the same by editing the applicationHost.config and adding the following line:

     <mimeMap fileExtension=”.csm” mimeType=”text/xml” />


    “Error encountered on HEAD request to manifest uri <your manifest> for <position> clip in RCE manifest”

    This will likely be the first issue you will encounter after trying to use a CSM. When using a CSM the Smooth Streaming Media Element (SSME) attempts to do a HEAD request on the manifest for each clip to make sure that the content hasn’t been moved (and if it has, it will used the new URL on the response).

    There are two changes you have to make in order to fix this issue.

    The first one is related to an existing known-issue on the applicationHost.config file of IIS. This server bug prevents the On-Demand smooth streaming handler from responding to HEAD request. To fix this go to the Smooth Streaming Readme page and check the Known Issues section, specifically the “Configuring the SmoothHandler handler mapping to process HTTP Head requests” item.

    The second change must be done on the clientaccesspolicy.xml file, essentially to indicate that HEAD requests are allowed. To fix this make sure that your clientaccesspolicy.xml file includes http-methods=”*”or http-methods=”GET,HEAD,POST”:

    <?xml version=”1.0″ encoding=”utf-8″?>
          <allow-from http-methods=”*” http-request-headers=”*”>    
            <domain uri=”*”/>
            <resource path=”/” include-subpaths=”true”/>


    “Caught exception trying to parse main manifest: V2 Manifest: Audio stream requires CodecPrivateData attribute”

    This is because the CSM contains a clip that is referring a V1 Manifest, which is not a valid source for a CSM.


    “Caught exception trying to parse main manifest: First video (audio) chunk in clip <position> [start time = <start time>, duration = <duration>] does not contain clip start position <clipStartPosition>”

    This message indicates that the first chunk time + the first chunk duration of the reported stream is smaller or larger that the clip’s begin position. Therefore the first chunk time + the first chunk duration of the stream must contain the clip’s begin position.


    “Caught exception trying to parse main manifest: Last video (audio) chunk in clip <position> [start time = <start time>, duration = <duration>] does not contain clip end position <clipEndPosition>”

    This message indicates that the last chunk time + the last chunk duration of the reported stream is smaller or larger that the clip’s end position. Therefore the last chunk time + the last chunk duration of the stream must contain the clip’s end position.


    Different Audio encoding settings in the CSM clips

    If you have clips with different audio encoding settings, then the playback will suddenly stop. Due to a limitation on Silverlight, the audio settings have to be the same. The Silverlight pipeline is not able to handle audio property changes on the fly. So make sure that the audio of the clips are being encoded at same bit rate.


    Sparse stream data within the clip

    This will likely not cause any issue, but as today having sparse stream data within a clip is not supported I decided to include it on this list.


    As you see, there are a couple of things to have in mind when creating and using composite stream manifests. I hope this post encourages you to use this amazing feature.


    Happy streaming!

    kick it on DotNetKicks.com

    Shout it

    Tags: , , , , , , , , , ,

    • m

      could you help me to do my testing.

      what we had before was: Silverlight app with SSME in it. SSME had .ism/Manifest in url, ism had head element with ismc in it…

      worked fine.

      now I am compeletely confused.

      what I tried and nothing works for me:
      a. ssme -> .csm (has clip elements with url -> ism (which has ismc))
      b. ssme -> .csm (has clip elements with url -> ism (which has NO ismc))
      c. ssme -> .csm (has clip elements with url -> ism (which has NO head item))
      d. ssme -> .ism/Manifest -> ismc which has clip elements with NO url

      the D did work if I hade one clip in it. If I add another clip it shows nothing…

      Is it possible to make a very simple example to demonstrate links between parts – Silverlight – ssme – manifest – composite manifest and show which file represent what? What is ism what is ismc and how ismc fit in this picture?

      Thank you

    • Yaroslav

      Hi, Ezequiel.
      I can`t make my SSME to play csm (*.isms work good).
      I`ve downloaded RCE project and tried to play one of the generated test csm-file (frame2.csm).
      But with no result. I see just black screen (without any errors/exceptions)
      Using Fiddler I caught request to the frame2.csm (it`s ok) and to the clientaccesspolicy (http://mediadl.microsoft.com/clientaccesspolicy.xml)
      But after these requests there are no requests for chunks.
      I`ve got IIS Media Services 4.0 Beta 1 and IIS Smooth Streaming Client 1.1 installed.
      I`ve also added .csm to the mimeTypes.
      What may be the reason of this? Could somebody help me?

    • Sergi Díaz

      Hi Ezequiel,

      I’m getting the “Error encountered on HEAD request” but I’ve done everything you say here. I can make that HEAD request from a different application and the result is OK, any idea what might be happening here?


    • JK

      After several tests and correspondence with Microsoft, we found that there’s a slight error on this document. The only valid values for http-methods (if specified), is “*”. It can not contain GET,HEAD,POST as what’s stated above.

      See: http://msdn.microsoft.com/en-us/library/cc645032%28v=VS.95%29.aspx

      Attribute: http-methods
      Required: No
      Default: Only the GET and POST method are allowed by the client HTTP handler.
      Description: Defines whether the client HTTP handler allows custom request methods other than GET and POST to be used. This policy only applies if the HTTP handler for a URI is changed to use the client HTTP handler.The default browser HTTP handler allows only the GET and POST request methods to be used.The only possible value for the request methods allowed by this policy element is the wildcard of “*”.

      So, to do CSM, you really need to have http-methods=”*” in your clientaccesspolicy.xml

    • lobatt

      I got the exactly problem m and Yaroslav had.
      that is, all configuration done according to the spec, no error reported in fiddler, used the Smooth Streaming Player SL4 from Microsoft as well as my own SL5 demo player with SSME control to play .csm files.
      thought the ism file played well, the .csm file will not play, thought all i do is just converted the whole .ismc file from the big bunny demo video to .csm file.

      2 years passed, no answer for this?

    • lobatt

      “Caught exception trying to parse main manifest: Last video (audio) chunk in clip [start time = , duration = ] does not contain clip end position ”

      What if the last video chunk and last audio chunk in a clip do not end in the same time position?
      Is there a validation logic we can follow to check if a clip could be played in composite manifest? or is there a Expression Encoder option to enforce that?

    • NirB

      Different Audio encoding settings in the CSM clips
      Is there a workaround for that? Maybe the new Silverlight version support that?