Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

How does "Auto" work in RTMP?


I am trying to understand how the "Auto" quality setting for RTMP works. In particular, I want to confirm that for a high-bandwidth connection, I get the high-quality video.

For browsers that support Flash, I set options.primary to 'flash', and I set up JWPlayer as follows:

playlist.sources = [{
file : URL FOR SMIL FILE,
type : "smil"
}];

The smile file for this particular video (which has four qualities) is as follows:

<smil>
<head>
<meta base="rtmp://s1yaos2riuxe0y.cloudfront.net/cfx/st"/>
</head>
<body>
<switch>
<video height="1078" width="1920" system-bitrate="1457000"
src="5390c461da06a0ac1f788265.mp4?Expires=1402411937&Signature=Xvo5r4~U-QDmu0FpnHJOkXYgupG~D3Bf1wzR1Ygi6Bu~nruIBbiqhaz~O1SZIjMe9zsIkAgKJnDppPHh9G6H4ZUMpN8zziGPoUHV5lnUuJnt108MdRh2QJXQRMmo6EIWd6e-A4BBUBvpQz3T6n0BhgcFmi7d0fpbVYq5jvjcEYA_&Key-Pair-Id=APKAJXYWFXCDTRLR3EFA"/>
<video height="720" width="1280" system-bitrate="801000"
src="5390c460da06a0ac1f788263.mp4?Expires=1402411937&Signature=IS1sKPf6~gJ1i8YPbpTplNj77rKqxFLbZJ~wkC7vfRxpEjW2W1JD5atIEUPlTPQNLhbnTZfNXEfgbNLf31eSTXiE7ZYByy9uOTtbYrNDow7trSvz0YWn-QrWcR-isQAjnl4WQ3O5HQPkpFCFhzUcqXEV7J5NlBiCUVGK6sDnx6A_&Key-Pair-Id=APKAJXYWFXCDTRLR3EFA"/>
<video height="360" width="640" system-bitrate="318000"
src="5390c45fda06a0ac1f788262.mp4?Expires=1402411937&Signature=TP0huz2hgOV97cSSIZizNQDpOfE1abU6~TCpkopPYYPfsP8yggrVm-f-MJ0~lcUpPtoIO3MfboaaUlGwCXeJk8W5lyZ6TiysFSHivgxbKj3lKK44~~eIPLaMHr-mfXzqaRz1gJa42fOEZC4ybeMNSuVIqQSQ~unRoLua0eilLHA_&Key-Pair-Id=APKAJXYWFXCDTRLR3EFA"/>
<video height="180" width="320" system-bitrate="113000"
src="5390c45fda06a0ac1f788261.mp4?Expires=1402411937&Signature=m-Mup5jaa9sagXrESw4iz8a2CDsC0-xvWZtRoXSbjFnlAGq2N1e0DU1B0biE1NjSEAk7alFNdWYC1oj1oQCEGLQkBlvBIxHYE4ROPokJoO354Mu3LIEZeXlSNg1ArHtWW6kaOCQ39XVUEbbMS-oXlJrWxroyuWZ9tFGFmf3eAc4_&Key-Pair-Id=APKAJXYWFXCDTRLR3EFA"/>
</switch>
</body>
</smil>

I set up an onQualityChange event handler to log what's going on.

In this event handler, player.getQualityLevels() returns:

[
{
"label": "Auto"
},
{
"height": 1078,
"id": "mp4:5390c461da06a0ac1f788265.mp4?Expires=1402412876&Signature=a0cI1wXaUvklU5SA5xawkzkX2b5AycM4CpVR3cyUd-2jMQMnfD7vY7cTF0TeehbFzNSpgNaWJb4O6pxOdjTZcuLcJ3HugcJiJNCfEisFrFtY5T-Fmy-TnLc3GeZfHnhf--E0ONCIPop73DiKT2zgYlgv~cfHXrdTkvPk9Yod7Wc_&Key-Pair-Id=APKAJXYWFXCDTRLR3EFA",
"width": 1920,
"bitrate": 1423,
"label": "1078p"
},
{
"height": 720,
"id": "mp4:5390c460da06a0ac1f788263.mp4?Expires=1402412876&Signature=nMqqwQ7pmFbW9Iluy69ROQ9pIev6pFpBYTjxxvBckrDHCZ7k0wgFS3Wza4FdU72FkeMdxpRKj1B6iZKCayuVwd1NVqjfOuZxERS4M7Oov~UAao0eKIiKa0gXAKGsnY2Tb6FNcpdgtdyOmtSxbnPNrk1FNqPgwZZXCvaBkRhlEHI_&Key-Pair-Id=APKAJXYWFXCDTRLR3EFA",
"width": 1280,
"bitrate": 782,
"label": "720p"
},
{
"height": 360,
"id": "mp4:5390c45fda06a0ac1f788262.mp4?Expires=1402412876&Signature=EYVwh-i54xLHdtZEKXbqBxzXYpoPEFdvmK2FQFMA31uXj-hNrQ6BPo1At3WDbDL6iNhvQ6MPt4jN5CTjDnJvUyEpSdbu888j7RXSZhQeJBkBbh8uFTo4LcrjNQSUTi7Ua8x~79a~t8tpCbRBwlLOwB4GFkJqUPjZPadHGgin6VI_&Key-Pair-Id=APKAJXYWFXCDTRLR3EFA",
"width": 640,
"bitrate": 311,
"label": "360p"
},
{
"height": 180,
"id": "mp4:5390c45fda06a0ac1f788261.mp4?Expires=1402412876&Signature=ScREDPPaeZ0rSEsoCO4mr5Xr2ZRrN0GVrCq49Cs-yuZ~k2kZA2ZgkAr96eGziwPZH9Z-j1iptx886lrt4yUzxdZgxTfrXmU6wvJaDk~t7KsjGi~rJV-WG23rzuyRt7tFqLZH4Ky53AxVrBTyb3CJ8da5GHL-39-65E45ob8vCr8_&Key-Pair-Id=APKAJXYWFXCDTRLR3EFA",
"width": 320,
"bitrate": 110,
"label": "180p"
}
]

This seems correct.

When I select a quality, event.currentQuality is always the value you'd expect based on the array above. But player.getCurrentQuality() always returns 3, no matter what the previous or current selection is (why?). Just from looking at it, I think "Auto" is choosing 360p. But we have plenty of bandwidth—the 1080p version displays perfectly well if I explicitly choose it.

How can I see which of the videos the player actually chooses for "Auto"? Can I influence it to make a more reasonable choice?

Thanks,
David Haimson

6 Community Answers

services

User  
0 rated :

More info: I read http://support.jwplayer.com/customer/portal/questions/6518907-dynamic-streaming-adaptive-bitrate-best-practices-and-behavior-questions, which was helpful, and I added an onMeta event handler. Typical value of event.metadata is:
onMeta: metadata: {
"qualitylevel": 2,
"bandwidth": "4147",
"bufferfill": 0,
"screenwidth": 794,
"transitioning": "false",
"width": 640,
"height": 360,
"duration": 5.005
}

Quality was set to "Auto". Over the period I was testing, bandwidth varied between 852 to 4154, but qualityLevel was always 2 (360p). Is this just a feature of RTMP? Again, any way I can influence it?

Ethan Feldman

JW Player Support Agent  
0 rated :

This is mainly because RTMP auto will only default at the start of the connection, it won’t change much during playback. This is something we want to fix for a future release though (better auto support in RTMP).

services

User  
0 rated :

Well, thanks. I'm definitely in favor of that being fixed.
David Haimson

Ethan Feldman

JW Player Support Agent  
0 rated :

Np

damian

User  
0 rated :

On this topic - is there a way to disable the auto bitrate detection entirely when using RTMP and .smil files? I'd rather have the user manually request higher bitrates -- the bitrate detection doesn't seem to work too well in our environment.

Ethan Feldman

JW Player Support Agent  
0 rated :

When smil is used, auto will be added. You could always use multiple links to single rtmp files on the page though and have them load in our player using the api.

This question has received the maximum number of answers.