Nov. 06, 2009LarryB
I've just read a long thread on bitrate switching not working, but I'm not sure how it was resolved. I'm using the licensed 4.6.485 player, and an RSS or ATOM playlist to handle bitrate switching over rtmp streamed from Limelight Networks.
Using QualityMonitor, I can see that the bandwidth is being detected properly, and the "Level" output in QM is telling me that it's picking the correct stream; BUT, the actual stream that's being displayed is the incorrect one. It's always the last one in the media:group that is actually played.
I've played with things suggested in the prior thread on this topic - changing the widths to be different for each media:content element, etc. Nothing makes it work.
Here is the RSS version of my playlist:
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:jwplayer="http://developer.longtailvideo.com/trac/wiki/FlashFormats">
<channel>
<item>
<media:group>
<media:content bitrate="384" width="480" url="ChildhdVidTrailerFinalSep09QT_384.flv"/>
<media:content bitrate="256" width="480" url="ChildhdVidTrailerFinalSep09QT_256.flv"/>
<media:content bitrate="128" width="480" url="ChildhdVidTrailerFinalSep09QT_128.flv" />
<media:content bitrate="64" width="480" url="ChildhdVidTrailerFinalSep09QT_64.flv"/>
</media:group>
<jwplayer:streamer>rtmp://media.isites.harvard.edu/a2232/e1/media/ChildhdFinEncodVids/ChildTrailer/</jwplayer:streamer>
<jwplayer:type>rtmp</jwplayer:type>
</item>
</channel>
</rss>
I don't see this listed as an active ticket in trac, so I'm not clear on whether this is a confirmed bug, or there's a solution/workaround that I've missed. Any info or assistance would be welcome...
Thanks,
Larry
Nov. 06, 2009hobbs
Your server does not appear to support bitrate switching.
Compare your track to the FMS v3.5 track in the Longtail Video example bitrate switching playlist. Your server does not switch the bitrate when toggling between fullscreen and normal.
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:jwplayer="http://developer.longtailvideo.com/trac/wiki/FlashFormats">
<channel>
<item>
<title>RTMP Streaming - Larry</title>
<description>When an FMS 3.5 server is detected, bitrate switching is also continously done while watching the video.</description>
<media:group>
<media:content bitrate="384" url="ChildhdVidTrailerFinalSep09QT_384.flv" width="580" />
<media:content bitrate="256" url="ChildhdVidTrailerFinalSep09QT_256.flv" width="480" />
<media:content bitrate="128" url="ChildhdVidTrailerFinalSep09QT_128.flv" width="380" />
<media:content bitrate="64" url="ChildhdVidTrailerFinalSep09QT_64.flv" width="280" />
</media:group>
<jwplayer:type>rtmp</jwplayer:type>
<jwplayer:streamer>rtmp://media.isites.harvard.edu/a2232/e1/media/ChildhdFinEncodVids/ChildTrailer/</jwplayer:streamer>
</item>
<item>
<title>RTMP Streaming (FMS)</title>
<description>When an FMS 3.5 server is detected, bitrate switching is also continously done while watching the video.</description>
<media:group>
<media:content bitrate="1600" url="videos/8Juv1MVa-67727.mp4" width="1080" />
<media:content bitrate="1200" url="videos/8Juv1MVa-485.mp4" width="720" />
<media:content bitrate="800" url="videos/8Juv1MVa-484.mp4" width="480" />
<media:content bitrate="400" url="videos/8Juv1MVa-483.mp4" width="320" />
</media:group>
<media:thumbnail url="http://content.bitsontherun.com/thumbs/8Juv1MVa-480.jpg" />
<jwplayer:type>rtmp</jwplayer:type>
<jwplayer:streamer>rtmp://fms.12E5.edgecastcdn.net/0012E5</jwplayer:streamer>
</item>
</channel>
</rss>
Nov. 06, 2009LarryB
Ahhh...this is interesting! Seems that my server does support bitrate switching. Here's what I'm seeing.
If I load the page fresh, and my stream plays first, the detected bandwidth starts at about 5000kbps, but the chosen stream is 64k. The bandwidth then changes wildly, going up to ridiculous numbers, then down to 50 or even 0, then back up several times over the course of a minute or two. If I leave it plauing long enough, it will eventually switch up to the 384k stream. But it won't stay there long, as the bandwidth will dip back down to less than 100 for long enough and the stream then switches.
Now, if I play your element in the playlist (just by clicking the button on the player), the bitrate stays stable beween 10000 and 20000kbps, and the stream stays on the 800kbps.
Here's what's really odd -- if I now switch back to my stream, the bandwidth stays stable and it plays the 384 stream right from the beginning, and stays there for as long as I play. So playing your stream first makes my stream work right.
?!?
Nov. 06, 2009hobbs
Interesting!
I wonder if the Longtail Video FMS server is setting something in the player, which then makes the bitrate switching work.
As far as I know, there aren't any other flashvars to set for bitrate switching.
Maybe Jeroen or one of the other developers can give us some insight into this behavior.
One of the problems with measuring the available bandwidth, is that by it's very nature, bandwidth on the Internet varies wildly. Taking a rolling average works fairly well, but that takes time and everyone wants the video to start playing instantly at the optimum bitrate.
Nov. 06, 2009LarryB
I think I can describe what's happening here.
The problem is, at least in this case, that the first choice can't be the one that's picked. If I take my original media:group like this:
<media:group>
<media:content bitrate="384" url="ChildhdVidTrailerFinalSep09QT_384.flv" width="480" />
<media:content bitrate="256" url="ChildhdVidTrailerFinalSep09QT_256.flv" width="440" />
<media:content bitrate="128" url="ChildhdVidTrailerFinalSep09QT_128.flv" width="360" />
<media:content bitrate="64" url="ChildhdVidTrailerFinalSep09QT_64.flv" width="240" />
</media:group>
...and play it in a 480-width player, the first item evaluates true, and the behavior is what I described: QualityMonitor says it's chosen stream 1, but stream 4 is what plays; and the bitrate detection is all over the map and the switching doesn't work right.
But, if I add a new first choice and make it deliberately bogus:
<media:group>
<media:content bitrate="1000384" url="ChildhdVidTrailerFinalSep09QT_384.flv" width="20000" />
<media:content bitrate="384" url="ChildhdVidTrailerFinalSep09QT_384.flv" width="480" />
<media:content bitrate="256" url="ChildhdVidTrailerFinalSep09QT_256.flv" width="440" />
<media:content bitrate="128" url="ChildhdVidTrailerFinalSep09QT_128.flv" width="360" />
<media:content bitrate="64" url="ChildhdVidTrailerFinalSep09QT_64.flv" width="240" />
</media:group>
...then it correctly chooses and plays the second item, and the bandwidth detection numbers stay stable and reasonable, and if I throttle the network bandwidth, the switching works. It does not matter if the first choice is not chosen because I set a too-high bitrate, or a too-high width. Either one evaluating 'false' will make the other options select and play correctly.
Nov. 06, 2009hobbs
AWESOME!
Something is "buggy". But that's a good workaround for now.
It even makes bitrate switching work on the Red5 RTMP server where I had given up all hope!
You might want to screw around with this Test Page a bit, the video changes as you change the player's display size. Your playlist, Longtail's playlist, and a couple of mine are selectable.
http://willswonders.myip.org:8074/Simple_bitrateSwitchingRTMP.html
Here are some helpful links to learn more about the JW Player™:
Earn money with ads from LongTail's AdSolution. Watch our demos and sign up now!
If you don’t buy a commercial license, you cannot use a JW Player™ on (i) a site that has ads; (ii) a corporate site; or a (iii) CMS. Our licenses are very inexpensive, so what are you waiting for? Buy a license today.