1 Reply Latest reply on Jan 19, 2011 1:48 AM by Silviu Vergoti

    Stream aliases and dynamic streaming

    Robert Reinhardt Level 2
      My recent tweets (@flashfreaker) have centered around getting dynamic streaming via RTMP working with my Wowza EC2 implementation on the cloud. While I'm a big fan of FMS/FMIS (I wrote some of the first Flash Communication Server coverage after all. ), I needed a server tech that would enable me to stream to multiple platforms, not just Flash. (I really hope Flash Media Server becomes "Adobe Media Server" one day, and can pull off the same capabilities as Wowza!)
      I was running into Error #1009 a lot with the Strobe Media Player (any version, up to 1.5.1) because I'm using stream aliases with Wowza. After getting deeper into the OSMF docs, I found that DynamicStreamingResource 's internal method indexFromName uses:
      internal function indexFromName(name:String):int
      {
           for (var i:int = 0; i < _streamItems.length; i++)
           {
           // FM-925, stream name may be appended with parameters.
                if (_streamItems[i].streamName.indexOf(name) == 0 ||
                     _streamItems[i].streamName.indexOf("mp4:" + name) == 0
                )
                {
                     return i;
                }
            }
           return -1;
      }
      But, my F4M manifest files use stream aliases, which are then converted to full paths in server-side Java for streaming. For example, a stream name of "R3R21/Inception_Trailer_2700K.mp4" is listed in the manifest, but the server looks up authentication/etc on the id, and then returns a stream from "mp4:amazons3/s3.videorx.com/R3R21/Inception_Trailer_2700K.mp4". It seems that the indexFromName() method wants the streamName to be EXACTLY the same as that specified in the manifest. Once I discovered this, it was easy enough to fix with:
      internal function indexFromName(name:String):int
      {
           for (var i:int = 0; i < _streamItems.length; i++)
           {
                // FM-925, stream name may be appended with parameters.
                if (_streamItems[i].streamName.indexOf(name) == 0 ||
                     _streamItems[i].streamName.indexOf("mp4:" + name) == 0 ||
                     _streamItems[i].streamName.substr(_streamItems[i].streamName.lastIndexOf("/") + 1) == name.substr(name.lastIndexOf("/") + 1)
                ) 
                {
                     return i;
                }
           }
           return -1;
      }
      Here, I'm just using the actual filename part of the stream path instead of the whole path in the comparison. I consider this bug, but only if stream aliases are used. I know FMS can use stream aliases too, but I'm not sure they're implemented the same as Wowza's implementation.
      Has dynamic streaming in OSMF been tested using stream aliases in FMS?
      Also, I'm not well versed yet in plugin authoring for OSMF. Can I write a videoRx.com plugin for OSMF that overrides this method so the lookup behaves correctly?
      Many thanks in advance for anyone's suggestions.