Skip to content

Conversation

@PikachuEXE
Copy link
Collaborator

@PikachuEXE PikachuEXE commented Sep 17, 2025

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Related issue

Closes #7145
#7887

Description

Based on #7145 (Please read that PR first
Using https://github.com/LuanRT/googlevideo 4.0.4

  • Implementation updated (different from Local API: Implement SABR for VODs #7145) to have playback session scoped stuff like SABR context & playbackCookie (SABR details)
  • Player streaming timeout doubled (30s > 60s) to handle sometimes ~40MB response instead of ~10MB (at 2k quality, e.g. https://youtu.be/NmdXl7vXZ7g)
  • New setting for enabling SABR in experimental section

Non-SABR

Screenshots

Lazy maybe add later?

Testing

A. SABR off

  • Test pre-roll ads time toast
  • Test various video playback (should be the same)

B. SABR on

  • Test various video playback (should be the same)

Find custom builds at https://github.com/PikachuEXE/FreeTube/actions/workflows/build.yml?query=branch%3Asabr-pr
Find cutting edge custom builds (I only use this branch for testing fixes myself, but can be outdated once I finished testing): https://github.com/PikachuEXE/FreeTube/actions/workflows/build.yml?query=branch%3Acustom-builds%2Fsabr

Desktop

  • OS:
  • OS Version:
  • FreeTube version:

Additional context

Remaining tasks

  • Add/Update labels/tooltips/toasts & make them translatable (after text confirmed)
  • Handle infinite player reload - Allow max 3 player reloads for the same video before fallback to older DASH, if player loaded the reload doesn't count
  • Handle player reload during playback - Reload while keeping timestamp
  • Handle SABR playback delay in the middle - keep toast for now
  • Handle infinite SABR playback delay - reload player after (per req) backoff requested 5 times / cumulative delay going to be larger than timeout for request
  • Handle infinite next request policy received - reload player after (per req) next request policy received 100 times
  • Enable SABR by default
  • Handle more edge cases if found

Post PR

  • Remove download feature (broken anyway)

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) September 17, 2025 02:45
@github-actions github-actions bot added PR: dependencies Pull requests that update a dependency file PR: waiting for review For PRs that are complete, tested, and ready for review labels Sep 17, 2025
@efb4f5ff-1298-471a-8973-3d47447115dc

Didnt test yet but im very sure this will close the SABR related issues

#7119
#6683

@absidue absidue mentioned this pull request Sep 17, 2025
1 task
@absidue
Copy link
Member

absidue commented Sep 17, 2025

I really hope it being an experimental setting that is disabled by default is just because you have some things left in the remaining tasks section...

@PikachuEXE
Copy link
Collaborator Author

I don't think it should be enabled by default for the first release
Otherwise there might be too many feedbacks to be handled
Whether it should remain in experimental section depends on how many edge case found and not handled well (Might be moved or not before next release

@absidue
Copy link
Member

absidue commented Sep 17, 2025

If we are going to keep it as a setting for the moment, it definitely should stay in the experimental settings and we should have a very clear plan for getting rid of it ASAP. The MWEB workaround is a workaround and is unlikely to keep working forever, so if it breaks while we still allow people to not use SABR we will have to keep finding new workarounds, which quite frankly I don't want to have to do when we know that SABR is the proper solution.

If we keep it a setting I would suggest enabling it by default but having the setting there as a temporary opt-out, that way we'll get more feedback but people can also disable it temporarily if they have issues, until you've decided it is stable enough.

Copy link
Member

@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both with and without SABR i get this error but that is on a server that is running through tor. If i connect to a normal server it does work

VirtualBoxVM_pCIApV5i4Z.mp4

@github-actions github-actions bot added PR: merge conflicts / rebase needed and removed PR: waiting for review For PRs that are complete, tested, and ready for review labels Sep 21, 2025
@github-actions
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@efb4f5ff-1298-471a-8973-3d47447115dc

Im not seeing the return of audio tracks -> #6683

* development: (24 commits)
  Add proxy login support (FreeTubeApp#7996)
  Migrate the History view to the composition API (FreeTubeApp#8064)
  Fix player button hiding (FreeTubeApp#8065)
  Translated using Weblate (Norwegian Bokmål)
  Translated using Weblate (Indonesian)
  Fix playback rate reset when video ends (FreeTubeApp#7718)
  Skip Electron binary download in CI as we do not run it (FreeTubeApp#8063)
  Feat: Display player overlay controls on keyboard interaction (FreeTubeApp#7757)
  Translated using Weblate (Hungarian)
  Translated using Weblate (Czech)
  Translated using Weblate (Estonian)
  Translated using Weblate (French)
  Bump electron from 37.4.0 to 38.1.0 (FreeTubeApp#8025)
  Translated using Weblate (Dutch)
  Translated using Weblate (Portuguese (Brazil))
  Translated using Weblate (German)
  Translated using Weblate (Breton)
  Translated using Weblate (Italian)
  Translated using Weblate (Chinese (Simplified Han script))
  Support exporting single playlists as a list of video URLs (FreeTubeApp#8054)
  ...

# Conflicts:
#	src/renderer/components/ft-shaka-video-player/ft-shaka-video-player.js
@github-actions
Copy link
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

@PikachuEXE
Copy link
Collaborator Author

Test fix not pushed this this PR yet: https://github.com/PikachuEXE/FreeTube/actions/runs/17907855602

@efb4f5ff-1298-471a-8973-3d47447115dc

Seems to resolve #7921 but we have to check with users after release

@ArthurKun21
Copy link

Test fix not pushed this this PR yet: https://github.com/PikachuEXE/FreeTube/actions/runs/17907855602

Was using this and got hit with 404 earlier for a music

https://youtu.be/8tamOu8AwFE

bundle-1758589261369.log

It was only once so far.

* development:
  Bump the eslint group across 1 directory with 4 updates (FreeTubeApp#8073)
  Bump electron from 38.1.0 to 38.1.2 (FreeTubeApp#8071)
  Bump sass from 1.92.1 to 1.93.0 (FreeTubeApp#8067)
  Bump lefthook from 1.13.0 to 1.13.1 (FreeTubeApp#8072)
  Bump swiper from 12.0.1 to 12.0.2 (FreeTubeApp#8070)
  Translated using Weblate (Italian)
  Translated using Weblate (Czech)
  Translated using Weblate (Hungarian)
  Translated using Weblate (German)
  Translated using Weblate (Estonian)
  Translated using Weblate (Breton)
  Translated using Weblate (German)
  Translated using Weblate (Chinese (Traditional Han script))
  Improve playlist import performance (FreeTubeApp#8062)
  Translated using Weblate (Norwegian Bokmål)
  Translated using Weblate (Portuguese (Brazil))
  Translated using Weblate (Chinese (Simplified Han script))
  Translated using Weblate (Japanese)
  Handle lockup view videos without a view count (FreeTubeApp#8066)
Due to duration somehow being slightly longer than what's available
@PikachuEXE
Copy link
Collaborator Author

Maybe last build - https://github.com/PikachuEXE/FreeTube/actions/runs/18607715883
Fixed issues in PikachuEXE#83 (maybe OS specific no idea)
Added a tweak to load less data for video/audio requests (no idea how to test if it really loads less data) taken from https://github.com/LuanRT/googlevideo/blob/googlevideo-v4.0.4/src/core/SabrStreamingAdapter.ts#L426

@ArthurKun21
Copy link

Hello, thanks for the work. Just wanna say for future reference.

The issue in PikachuEXE#83 like the video getting stuck in the link https://youtu.be/8sJCPuweieA was present in both windows and mac machine. But the issue was already fixed with the succeeding commits

@pnaf
Copy link

pnaf commented Oct 18, 2025

I just wanted to add that the stuck player issue in that link was also happening on Linux (I was also encountering the issue at the end of https://youtu.be/vBynw9Isr28, for example). So it seems less likely that this is an OS-specific issue.

The new build with the workaround did fix that issue for me. Thanks!

@github-actions
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

due to use of duration from first format with format of shorter duration selected for playback
* development:
  Bump the eslint group with 4 updates (FreeTubeApp#8158)
  Translated using Weblate (German)
  Bump shaka-player from 4.16.4 to 4.16.6 (FreeTubeApp#8167)
  Bump marked from 16.4.0 to 16.4.1 (FreeTubeApp#8159)
  Bump electron from 38.2.2 to 38.3.0 (FreeTubeApp#8161)
  Bump actions/setup-node from 5 to 6 (FreeTubeApp#8162)
  Bump youtubei.js from 16.0.0 to 16.0.1 (FreeTubeApp#8163)
  Translated using Weblate (Persian)
  Translated using Weblate (Czech)
  Translated using Weblate (Bulgarian)

# Conflicts:
#	package.json
@github-actions
Copy link
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

@PikachuEXE
Copy link
Collaborator Author

Maybe last build 2 - https://github.com/PikachuEXE/FreeTube/actions/runs/18669891374
Fixed issues in PikachuEXE#83 with better fix and re-tested by issue opener
Previous fix might not work in some cases (but can't really find an example yet) but this one should work for all
Details in PikachuEXE#83 (comment)

@PikachuEXE PikachuEXE added the PR: waiting for review For PRs that are complete, tested, and ready for review label Oct 21, 2025
* development:
  Translated using Weblate (Russian)
  Bump the eslint group with 2 updates (FreeTubeApp#8184)
  Bump the babel group with 2 updates (FreeTubeApp#8185)
  Bump sass-loader from 16.0.5 to 16.0.6 (FreeTubeApp#8186)
  Bump electron from 38.3.0 to 38.4.0 (FreeTubeApp#8187)
  Bump swiper from 12.0.2 to 12.0.3 (FreeTubeApp#8189)
  Bump actions/upload-artifact from 4 to 5 (FreeTubeApp#8188)
  Bump lefthook from 2.0.0 to 2.0.1 (FreeTubeApp#8190)
  Handle lockup views with no published text or views (FreeTubeApp#8170)
  Translated using Weblate (Russian)
  Translated using Weblate (Russian)
  Remove Hide Channel from the kebab menu on the Subscriptions page (FreeTubeApp#8175)
  Translated using Weblate (French)
  Translated using Weblate (Latvian)
  Translated using Weblate (Latvian)
  Translated using Weblate (Portuguese (Portugal))
  Bump lefthook from 1.13.6 to 2.0.0 (FreeTubeApp#8166)
@kommunarr
Copy link
Collaborator

Not sure why, but this video causes the SABR to get stuck in a loop refreshing the video constantly. Even after leaving it and trying to watch any other video, they also get stuck in a SABR loading loop until I terminate and restart FreeTube.

* development: (21 commits)
  Replace vue-portal dependency with Vue's built-in <Teleport> component (FreeTubeApp#8207)
  Update to Vue 3 (FreeTubeApp#8094)
  Translated using Weblate (Basque)
  Translated using Weblate (Hungarian)
  Translated using Weblate (Icelandic)
  Translated using Weblate (Turkish)
  Properly fix CORS in PO token web views (FreeTubeApp#8203)
  Translated using Weblate (Italian)
  Translated using Weblate (Norwegian Bokmål)
  Translated using Weblate (French)
  Configure nedb to always clean up corrupted data (FreeTubeApp#8202)
  Translated using Weblate (Portuguese (Brazil))
  Add video paused check to frame shortcuts (FreeTubeApp#8200)
  Fix toast with timeout 0 will be displayed for default 3s (FreeTubeApp#8168)
  Translated using Weblate (Chinese (Simplified Han script))
  Change containing text input limit (FreeTubeApp#8174)
  Translated using Weblate (Dutch)
  Add support for AppImageUpdate (FreeTubeApp#8153)
  Added New Window option to Tray (FreeTubeApp#7995)
  Translated using Weblate (Japanese)
  ...
@PikachuEXE
Copy link
Collaborator Author

@kommunarr Sorry I can't reproduce SABR loop (reload loop?). It just starts playing right after backoff time
I have no idea if it's random or what (it's rare and doesn't happen again with the same video

@kommunarr
Copy link
Collaborator

Yes, an infinite reloading of the player. It still occurs consistently for me on that one video, although for unknown reasons, my other videos are still playing fine this session after encountering this error as opposed to last time. Here's what showed up in the console on the player reloading FWIW:

renderer.js:2 Player Error (category and code explainations here: https://shaka-player-demo.appspot.com/docs/api/shaka.util.Error.html)
Video ID: "i25z70gPuAU"
FreeTube player context: "loading dash/audio manifest and setting default quality in mounted"

Severity: CRITICAL (2)
Category: undefined (undefined)
Code: undefined (undefined)
Stack trace:
TypeError: Cannot read properties of null (reading 'Qa')
    at Of (renderer.js:2:460753)
    at Object.get [as isAudioOnly] (renderer.js:2:456898)
    at renderer.js:2:2399284
    at renderer.js:2:99774
    at renderer.js:2:101470
    at renderer.js:2:101711

* development:
  Translated using Weblate (German)
  Translated using Weblate (German)
  Bump shaka-player from 4.16.6 to 4.16.8 (FreeTubeApp#8223)
  Translated using Weblate (Croatian)
  Bump globals from 16.4.0 to 16.5.0 (FreeTubeApp#8216)
  Bump eslint-plugin-jsdoc from 61.1.11 to 61.1.12 in the eslint group (FreeTubeApp#8222)
  Translated using Weblate (Czech)
  Translated using Weblate (Estonian)
  Bump lefthook from 2.0.1 to 2.0.2 (FreeTubeApp#8213)
  Bump sass from 1.93.2 to 1.93.3 (FreeTubeApp#8214)
  Bump the eslint group with 3 updates (FreeTubeApp#8211)
  Remove broken restart window keyboard shortcut (FreeTubeApp#7281)
  Translated using Weblate (Vietnamese)
  Translated using Weblate (Hebrew)
  Translated using Weblate (Chinese (Traditional Han script))
  Migrate FtInput to the composition API (FreeTubeApp#8208)
@PikachuEXE
Copy link
Collaborator Author

PikachuEXE commented Nov 4, 2025

If you see a toast about reading then it's handling SABR reload request (which is caused by unknown reason and hard to reproduce)
The error is raised due to reload (Running player.isAudioOnly() I guess and player is gone, so it's not causing it
I can try to make the error disappear

Update 1: Build with error fix (will still emit LOAD_INTERRUPTED but it's shaka behaviour): https://github.com/PikachuEXE/FreeTube/actions/runs/19053961955

@StevenNL2000

This comment has been minimized.

@PikachuEXE
Copy link
Collaborator Author

After 3 reloads I coded it to fallback to non SABR...

* development:
  Change clear filter button from text to icon (FreeTubeApp#8205)
  Feat clickable playlist progress bar (FreeTubeApp#7782)
  Add Hide channels based on text (FreeTubeApp#7948)
  Clean up defunct shaka-player types patching (FreeTubeApp#8224)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: dependencies Pull requests that update a dependency file PR: waiting for review For PRs that are complete, tested, and ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants