Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add adaptive streaming bitrate control to Clapper API #506

Merged
merged 8 commits into from
Nov 16, 2024
Merged

Conversation

Rafostar
Copy link
Owner

Allow setting start, min and max bitrates when streaming adaptive content such as DASH or HLS. This has potential to allow to implement video quality selector, although available representations bitrates are not yet forwarded to apps.

With this comes a GStreamer version bump to 1.24 and a switch to playbin3 by default. We do not want to introduce APIs that work only if user has a certain dependency version, thus this bump instead of version check. This is also needed for recently introduced adaptive streaming from clapper-enhancers to work correctly with default settings. All major Linux distros (including LTS) should be already on GStreamer 1.24, thus we should be able to bump this version without much complains now.

Related work on GStreamer side (since 1.24 - reason for version bump):
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3894
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3895

Add APIs to allow apps to select start, min and max bitrates for adaptive streaming.

Combining min+max values can allow to implement a video quality selector,
although possible bitrates/qualities are not communicated with an app yet.
New GStreamer adaptive demuxers work only within playbin3. In order to not
introduce new APIs (setting adaptive bitrate) that do not work by default
and to have the whole "clapper-enhancers" concept working correctly, its
about time to move on to playbin3.
@Rafostar
Copy link
Owner Author

Still need to update CI to latest runtime that has GStreamer 1.24 before merging.

Setting "start-bitrate" property requires at least GStreamer 1.24.

We do not want to introduce APIs that work only if user has a certain
dependency version, thus this bump instead of version check.

Related work on GStreamer side:
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3894
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3895

Since these were contributed to GStreamer almost 2 years ago with the intention
of using them in Clapper, I think its about time to start do so.
@Rafostar Rafostar force-pushed the adaptive branch 3 times, most recently from 68bdef2 to 8119d3b Compare November 14, 2024 22:12
We do not yet have GStreamer 1.24 in Flathub repo, so for testing purposes add it here temporarily
Apps can use it to determine and set an optimal value for
start bitrate instead of starting at some constant value.
Watch for "adaptive-bandwidth" changes during adaptive streaming, use these to
set "adaptive-start-bitrate" player property, so we do not always start streaming
from some constant bitrate value which might not be the best for everyone.

Additionally, store last value in GSettings on app exit and also add a command
line arg to set this too.
When new instance of adaptive demuxer is created (different video is played)
this prop value would become zero. We want to avoid that and instead report
only bandwidth after fragment is downloaded, so when video will be unplayable,
next one will not start from lowest quality.
@Rafostar Rafostar merged commit 2b916ef into master Nov 16, 2024
5 checks passed
@Rafostar Rafostar deleted the adaptive branch November 16, 2024 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant