After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 747558 - gsthlsdemux.c/gstadaptivedemux.c: Possible Improvement: Variant selection doesn't consider hysteresis
gsthlsdemux.c/gstadaptivedemux.c: Possible Improvement: Variant selection doe...
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-04-09 13:05 UTC by David Guthrie
Modified: 2018-11-03 13:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Backport of new variant selection algorithm from master to 1.4.5 (4.17 KB, patch)
2015-05-11 13:35 UTC, David Guthrie
none Details | Review
Add hysteresis to variant selection to avoid noise influencing selected variant (8.10 KB, patch)
2015-05-11 13:36 UTC, David Guthrie
none Details | Review

Description David Guthrie 2015-04-09 13:05:46 UTC
When the average bitrate is calculated, this resultant bitrate (when multiplied by bitrate_limit) could be very close to a variant in the m3u8 playlist file. Which could result in the variant selection oscillating between two different variants after each segment is downloaded. In any system which make a decision based on an input switching an output based on the inputs magnitude, it is normal to add hysteresis to the calculation as this will prevent random noise from causing instability. The instability in this cause would be the viewer being able to observe frequent changes in variants when playing back video.

A hysteresis variable could be added to the final bitrate value used to select the variant from the playlist. This variable is set to -50kbps when changing download a variant and set to 0 when changing up a variant. This would allow for 50kbps of noise in the final bitrate calculation which would not influence the variant selection when the download rate is near constant.
Comment 1 Thiago Sousa Santos 2015-04-09 19:36:12 UTC
I think this makes sense. Are you considering writing the patch, as well?
Comment 2 David Guthrie 2015-04-10 08:35:51 UTC
I'm looking at patching 1.4.5. I'll attached it to the issue when it's ready.
Comment 3 Thiago Sousa Santos 2015-04-10 12:38:15 UTC
It will be better if you patch master, 1.4.5 and master have diverted a lot already and we don't add new features to 1.4 branch, only bugfixes are allowed.
Comment 4 David Guthrie 2015-05-11 13:35:44 UTC
Created attachment 303213 [details] [review]
Backport of new variant selection algorithm from master to 1.4.5

These patches backport the new algorithm detailed in https://bugzilla.gnome.org/show_bug.cgi?id=742979 to 1.4.5

The next patch is to add Hysteresis is patched onto these changes.
Comment 5 David Guthrie 2015-05-11 13:36:51 UTC
Created attachment 303214 [details] [review]
Add hysteresis to variant selection to avoid noise influencing selected variant
Comment 6 Duncan Palmer 2015-12-23 15:37:00 UTC
I'm revisiting this for master... Our solution is currently specific to hlsdemux, and I'd like to change it so it can be used in adaptivedemux instead of requiring 3 separate implementations.

So, I was thinking along the following lines;
- Restore the bitrate averaging logic, which was (I think) mistakenly removed as part of https://bugzilla.gnome.org/show_bug.cgi?id=733959
- Apply a noise filter to the resulting bitrate; if the delta between the newly calculated bitrate and the previous is < some threshold (50 kpbs say), then keep the old bitrate.

Our previous solution applies hysterisis when a variant change is in the offing due to the new bitrate. This is why it's hls specific. However, simply applying a noise filter should achieve the same thing I believe.

Does anyone have any comments on this approach?
Comment 7 GStreamer system administrator 2018-11-03 13:33:48 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/236.