3 Replies Latest reply on May 20, 2015 11:32 PM by Win 8.1 debugger | Adobe

    RTMP Adaptive Switching Issue

    Win 8.1 debugger | Adobe

      Hello Sir.


      I have create a flash player using osmf plugin and smilplugin code which i found (fromhttps://getstreaming.wordpress.com/2011/05/27/dynamic-streaming-test-drive/#comment-349).


       

      I have an issue while playing  SMIL  file in my "custom player" through wowza media server.

      The issue is adaptive switching doesn't work in my custom player  in case of RTMP protocol, but my custom player play following smil url with adaptive switching and manual switching (@ !http://mediapm.edgesuite.net/ovp/content/demo/smil/elephants_dream.smil ).

       

      and also play  HDS and HSL Streaming through wowza media server.

      I appreciate your help.

       

       

      sample smil file which i am using for Wowza mentioned below

       

      <?xml version="1.0" encoding="UTF-8"?>

      <smil>

        <head>

        <meta base="rtmp://127.0.0.1:1935/vod/_definst_"/>

        </head>

        <body>

          <switch>

             <video src='mp4:main360.mp4' system-bitrate='200000' />

             <video src='mp4:main720.mp4' system-bitrate='480000' />

             <video src='mp4:sample.mp4' system-bitrate='720000' />

           </switch>

        </body>

      </smil>

        • 1. Re: RTMP Adaptive Switching Issue
          Sunil Kumar Sah Level 1

          Hi,

           

          Please use below methods for playing  RTMP SMIL -

           

           

          private var dynResource:DynamicStreamingResource;

          private var tracingNetLoader:TracingNetLoader;

          private var element :VideoElement;


           

           

          private function createSMILObj(str:String):void {

            try {

            var objSMIL:Object = createSMILObj(str); // Function give below

            var obj:Object = objSMIL["files"];

            var fileLen:Number = getObjLen(obj); // function given below

            dynResource = new DynamicStreamingResource(String(objSMIL["baseURL"]));

            vector = new Vector.<DynamicStreamingItem > (fileLen);

            for (var i:int=0; i<fileLen; i++) {

            vector[i] = new DynamicStreamingItem(obj[i].src,obj[i].bitrates,obj[i].width);

            }

            dynResource.streamItems = vector;

            tracingNetLoader = new TracingNetLoader();

            element = new VideoElement(dynResource,tracingNetLoader);

            //initPlayer(element);  // Pass this element in OSMF Object and play video.

          }catch (error:Error) {

            //trace("Error found in loading SMIL XML")

           

            }

            }

           

           

          public static function createSMILObj(_str:String):Object {

            var baseUrl:String;

            var smilXML:XML;

            var videoList:XMLList;

            var mainObj:Object = new Object();

            var fileObj:Object = new Object();

            var str:String;

            var tempArray:Array=_str.split("<head>");

            var tempStr:String = String("<smil><head>"+tempArray[1]);

            str=String(tempStr).split("<switch").join("<switchs");

            str=str.split("</switch").join("</switchs");

            str=str.split("system-bitrate").join("systembitrate");

            smilXML=new XML(str);

            baseUrl=smilXML.head.meta.@base;

            //trace("base = "+baseUrl);

            videoList=smilXML.body.switchs.video;

            try{

            for (var i:int = 0; i<videoList.length(); i++) {

            fileObj[i]={src:videoList[i].@src,bitrates:videoList[i].@systembitrate,width:videoList[i] .@width};

            }

            }catch(error:Error){

            trace("Error found in updating SMIL XML File.....")

            }

            mainObj["baseURL"]=baseUrl;

            mainObj["files"]=fileObj;

            return mainObj;

            }

           

           

           

          public function getObjLength(obj:Object):Number {

            var counts:Number=0;

            for (var id in obj) {

            counts++;

            }

            return counts;

            }

           

           

          Best regards,

          Sunil Kumar

          • 2. Re: RTMP Adaptive Switching Issue
            Win 8.1 debugger | Adobe Level 1

            Thanks Sunil,

             

            it work fine on local wowza for vod but at live stream it does fluctuate frequently between streams.it does not work at my end for public url like

            http://mediapm.edgesuite.net/ovp/content/demo/smil/elephants_dream.smil

            http://184.72.239.149/vod/smil:BigBuckBunny.smil/jwplayer.smil

             

            when i debug this i found DynamicStreamEvent.SWITCHING_CHANGE event is not trigger in case of public url.

            please help me.

             

            Thanks

            Shivam Gupta@

            • 3. Re: RTMP Adaptive Switching Issue
              Win 8.1 debugger | Adobe Level 1

              Can anybody tell me how to resolve above issue.If anybody has other way to play smil file with adaptive switching so please give your ideas.