Upgrade quality of existing buffered video segments when bufferingGoal is reached

448 views
Skip to first unread message

Hochhaus, Andy

unread,
Mar 29, 2017, 4:42:42 PM3/29/17
to Shaka Player Users
Hello,

For my use case, users who visit my page are performing another task for ~5 mins prior to watching a video. I load shaka player at page load in order to let it start buffering the video in the background while the user is working on something else. The video does not auto play. Due to this workflow, in my case, shaka almost always fills the buffer (i.e. reaches bufferingGoal).

However, when the video does start playing, the first portion (~30s) is in a low resolution. After that point, the remainder of the video will be in the highest resolution (assuming sufficient bandwidth). I think this is because shaka appears to start out downloading low resolution video until it has enough data to know that the connection supports high resolutions. This seems like a good assumption for video which plays immediately. However, for my use case, I would like to "upgrade" the low resolution buffered segments when the buffer is full assuming the video has not started playing yet.

Is this possible to configure with the current shaka buffer algorithm?

Best,
Andy

Hochhaus, Andy

unread,
Mar 29, 2017, 4:52:22 PM3/29/17
to Shaka Player Users
Said differently, when the buffer is full and therefore shaka is not downloading anything, I would like shaka to upgrade existing buffered segments which are not in the highest available quality. Is that possible?

Joey Parrish

unread,
Mar 30, 2017, 11:50:19 AM3/30/17
to Shaka Player Users
Hi Andy,

If I understand correctly, you want us to clear out some of the buffered data ahead of the playhead when we upgrade to a higher quality stream.  We used to do this, but it did not work well across browsers.  On some browsers, we needed hacky work-arounds to avoid visual glitches, and on others, it seemed that it was not possible to avoid them at all.  The only solution we found was simply not to remove buffered data ahead of the playhead.  (There seems to be no issue removing buffered data behind the playhead, which we still do to manage memory usage.)

To optimize your preloading experience, there are some things you can do.

First, you should understand that it typically takes around 2 segments for us to build a good bandwidth estimate.  That means that for content with 10-second segments, Shaka Player will buffer 20-30 seconds at the "default" bandwidth estimate before it adapts.  If you are preloading anyway, you may want to tweak that default so that you're preloading higher quality content.  To do this, use player.configure({ abr: { defaultBandwidthEstimate: bitsPerSecond }})

If you can still make changes to the content itself, consider using smaller segments.  We found that 4-second segments are a good balance between container overhead (lower with larger segments) and adaptation (quicker with smaller segments).  With 4-second segments, we can typically make an adaptation decision after only 8 seconds of content has been fetched.

You can also tweak the buffering goal with player.configure({ streaming: { bufferingGoal: goalInSeconds }}).  You may want a small buffering goal to keep Shaka Player from making decisions about content too far in the future.

One last thing you can do is persist the user's bandwidth estimate from one session to the next.  Use player.getConfiguration().abr.manager.getBandwidthEstimate() to query the current bandwidth estimate, then persist that for the next video or next application session.  When the page loads, check for this persisted value and use it to set defaultBandwidthEstimate.

Does this help?
-Joey


On Wed, Mar 29, 2017 at 1:52 PM, Hochhaus, Andy <ahoc...@samegoal.com> wrote:
Said differently, when the buffer is full and therefore shaka is not downloading anything, I would like shaka to upgrade existing buffered segments which are not in the highest available quality. Is that possible?

--
You received this message because you are subscribed to the Google Groups "Shaka Player Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shaka-player-users+unsub...@googlegroups.com.
To post to this group, send email to shaka-player-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shaka-player-users/CAAhqAFonfxXKe0Yer9TYrY%3DEaHNa3LQ5B7Cc7EbqH7sqFOGatA%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages