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

Use decodingInfo's powerEfficient property when picking streams #6061

Merged
merged 1 commit into from
Nov 2, 2024

Conversation

absidue
Copy link
Member

@absidue absidue commented Nov 1, 2024

Use decodingInfo's powerEfficient property when picking streams

Pull Request Type

  • Feature Implementation

Description

The MediaCapabilities decodingInfo function can be used to query Electron/the browser if it supports playback of a certain audio and video combination and whether it thinks it can do it smoothly (without dropping frames) and power efficiently (the spec doesn't list any specifics but at least in Chromium whether the stream can be played with hardware acceleration is considered, at least according to my research). At the moment FreeTube just tells shaka-player to prefer streams that can be played smoothly (it always filters out unsupported streams). This pull request also tells it to consider the powerEfficient property.

shaka-player picks the best one for each video quality/resolution option, so even if the API predicts that all 4K streams on a video will play dreadfully on a specific device, at least one of them will still be included. That means that users can't come up with complaints about missing quality options because of this :).

Testing

Unfortunately in this case I haven't been able to test the impact, as my device supports hardware accelerated playback for h264, VP9 and AV1.

Desktop

  • OS: Windows
  • OS Version: 10
  • FreeTube version: 59eff14

@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Nov 1, 2024
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) November 1, 2024 15:18
Copy link
Collaborator

@kommunarr kommunarr left a comment

Choose a reason for hiding this comment

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

Not sure how to validate on my device. Signing off based on the documentation and static code analysis.

Copy link
Collaborator

@PikachuEXE PikachuEXE left a comment

Choose a reason for hiding this comment

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

the spec is quite vague~

@FreeTubeBot FreeTubeBot merged commit 595436d into FreeTubeApp:development Nov 2, 2024
5 checks passed
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Nov 2, 2024
@absidue absidue deleted the mcap-power-efficient branch November 2, 2024 10:20
PikachuEXE added a commit to PikachuEXE/FreeTube that referenced this pull request Nov 4, 2024
* development: (153 commits)
  Migrate FtTimestampCatcher to the composition API (FreeTubeApp#6064)
  Translated using Weblate (Polish)
  Added functionality to export a single playlist (FreeTubeApp#5779)
  Fix video player displaying a vertical scrollbar when context menu outside player container (FreeTubeApp#6075)
  Fix use of deprecated Invidious route on the videos subscription tab (FreeTubeApp#6057)
  Apply active FreeTube theme to shaka-player menus (FreeTubeApp#5986)
  Bump sass from 1.80.4 to 1.80.6 (FreeTubeApp#6071)
  Bump mini-css-extract-plugin from 2.9.1 to 2.9.2 (FreeTubeApp#6068)
  Translated using Weblate (Vietnamese)
  Bump webpack from 5.95.0 to 5.96.1 (FreeTubeApp#6069)
  Translated using Weblate (Vietnamese)
  Bump sass-loader from 16.0.2 to 16.0.3 (FreeTubeApp#6070)
  Bump lefthook from 1.8.1 to 1.8.2 (FreeTubeApp#6067)
  Bump the eslint group with 2 updates (FreeTubeApp#6066)
  Bump youtubei.js from 11.0.0 to 11.0.1 (FreeTubeApp#6072)
  Migrate PasswordSettings and PasswordDialog to the composition API (FreeTubeApp#6036)
  Add some missing jsdoc comments, add jsdoc eslint plugin (FreeTubeApp#6048)
  Fix shortcut for macOS setting shortcut in video page (FreeTubeApp#6054)
  Use decodingInfo's powerEfficient property when picking streams (FreeTubeApp#6061)
  Translated using Weblate (Afrikaans)
  ...
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.

5 participants