Wowza Community

Wowza not sending NetStream.Play.Transition on stream switch

Hi ,

I am trying to play dynamic rtmp live stream via a smil file. I am using StrobeMediaPlayer for playing the smil file. smil file is hosted externally on our webserver.

I am publishing the stream to origin application (rtmp://[ip:1935]/origin) and trying to play the stream from edge application.

smil file looks like this

<smil title="SMIL file for live streaming">
        <head>
                <meta base="rtmp://[ip]:1935/Edge/_definst_"/>
        </head>
        <body>
               <switch>
                
              
	                <video src="mp4:myStream_360p" system-bitrate="534000">
	                        <param name="audioBitrate" value="64000" valuetype="data"/>
	                        <param name="videoBitrate" value="470000" valuetype="data"/>
	                        <param name="videoCodecId" value="avc1.66.21" valuetype="data"/>
	                        <param name="audioCodecId" value="mp4a.40.2" valuetype="data"/>
	                </video>
	                <video src="mp4:myStream_240p" system-bitrate="272000" >
	                        <param name="audioBitrate" value="32000" valuetype="data"/>
	                        <param name="videoBitrate" value="240000" valuetype="data"/>
	                        <param name="videoCodecId" value="avc1.66.21" valuetype="data"/>
	                        <param name="audioCodecId" value="mp4a.40.2" valuetype="data"/>
	                </video>
	                <video src="mp4:myStream_160p" system-bitrate="136000" >
	                        <param name="audioBitrate" value="16000" valuetype="data"/>
	                        <param name="videoBitrate" value="120000" valuetype="data"/>
	                        <param name="videoCodecId" value="avc1.66.21" valuetype="data"/>
	                        <param name="audioCodecId" value="mp4a.40.2" valuetype="data"/>
	                </video>
        </switch>
        </body>
</smil>

When the player starts it plays the myStream_360p as expected . But when it tries to go to a lower bandwidth it calls netstream.play2(lower_index) and expects wowza to return back NetStream.Play.Transition , which never happens. hence player is stuck playing only one stream.

I also noticed that when i try to play the stream from origin app the wowza is returning the NetStream.Play.Transition and switch is happening properly.

Any ideas why this might be happening ?

Hi there.

Please take a look at this guide:

How to create and play SMIL files with streams created by Wowza Transcoder

As ngrp do not get forwarded to the edge, the idea is that with this tool you can create a SMIL from using the medialist tool on the origin and create a file that you host in the content folder on the edge.

I hope this helps.

Salvadore

Actually, I am experiencing the very same issue with Wowza 3.6.4 working in RTMP live repeater mode, when changing simply from one quality to the other, NetStream.Play.TransitionComplete is never sent. None of the above advice resolve this.

Any idea if this was fixed in later releases?

Thanks.

No, I am using an own developed Flash player. After debugging, it is clear that the event is not coming from Wowza edge.

Thanks a lot. Then the same can be expected with latest (v4) Wowza versions I guess. I tried to set up an Nginx based RTMP reflector, and it worked without a problem.

What you suggest with Adobe HDS and Apple HLS?

Hi Gaurav, I am sorry I missed this detail in your original post.

RTMP does not support server-side .smil files.

There is a convenience method for JW Player found here:

How to use JW Player with adaptive bitrate streaming from Wowza Streaming Engine

You may find this guide helpful as well:

How to lock multi-bitrate streams on live stream repeater edge

Thank you.

Salvadore

Hi Salvadore,

I am able to create proper smil file. if i place the above mentioned smil file in content directory of my edge node the stream is working as expected for HTTP streaming protocols(HDS, HLS etc) . But i am trying to use rtmp to play the stream (because of lower latency) . So assuming the correct smil file is present in content directory for my edge node what is the stream url i should use for playing the stream using rtmp (adaptive bitrate).

-Gaurav

Hi Salvadore,

I was trying to follow jwplayer example but only with a osmf player which have capabilty to parse and play smil file .

http://[wowza-ip-address]:1935/vod/smil:sample.smil/jwplayer.smil

if this url just produces a smil file then i assume in theory i can host a equivalent smil file on my webserver with the change that ip in tag pointing to a wowza edge server and my player should work properly. But issue here is when my player parses the smil file it starts playing the stream which appears first in the list. When player tries to switch to a lower bitrate stream it tries to do a handshake(expects NetStream.Play.Transition) with wowza server which does not happen.

However when i put origin server ip in head tag of smil file , this functionality works as expected with proper handshaking and switching.

I dont know which module of wowza is responsible to do the handshake and is it possible to override its code to do what i am trying to do.

Are you using jwplayer ?

If yes then the issue is not with wowza but with jwplayer’s implementation of dynamic rtmp. in case of rtmp playback jwplayer simply determines clients bandwidth at start of playback and chooses appropriate rendition of stream , afterwards for the whole session it sticks to the same rendition. therefore it never calls play2() .

http://support.jwplayer.com/customer/portal/questions/9902698-stream-switching-without-play2-

If you are trying to play streams from edge servers then this can happen since edge server doesnt know what streams are available on origin.

You will need to call FCSubscribe method from your video player code for “holding” streams on edge servers.

nc.call(“FCSubscribe”, null, “live_1”);

nc.call(“FCSubscribe”, null, “live_2”);

nc.call(“FCSubscribe”, null, “live_3”);

where live_1 live_2 and live_3 are three renditions of streams with diff bitrates.

Yes, I am using wowza v4.x and i had to do FCSubscribe thing to get it working. For nginx it works without calling FCSubscribe methods.