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

Filter out WebM DASH formats #3105

Merged
merged 2 commits into from
Jan 25, 2023

Conversation

absidue
Copy link
Member

@absidue absidue commented Jan 22, 2023

Filter out WebM DASH formats

Pull Request Type

  • Bugfix
  • Feature Implementation

Description

video.js only supports MP4 DASH, so when the player catches wind of the WebM DASH formats it breaks down. This pull request filters out the WebM DASH formats. It also adds a setting to choose between using the MP4 AV1 formats if they are available or always use the MP4 H.264 formats.

Only allowing the quality selector to see the MP4 H.264 formats, seems to make it work sometimes, unfortunately switching between qualities with AV1 formats is still broken.

AV1 formats retain more quality than H.264 formats, so they are definitely preferred, unfortunately they are also more demanding on your hardware, especially if you don't have dedicated hardware AV1 decoders.

This also fixes the duplicate qualities in the selector in almost all situations, HDR qualities still show two, they seem identical except the itag and almost double as high bitrate on one format compared to the other. My guess is that they might be different HDR implementations or maybe one is SDR and the other is HDR but they are both labelled as HDR.

LTT video about AV1: https://www.youtube.com/watch?v=WVjtK71qqXU
Tom Scott video about why YouTube's compression can't cope with snow and confetti (even though it's a 6 year old video it has AV1 formats, I wonder if YouTube used it for testing purposes): https://youtu.be/r6Rp-uo6HmI

Testing

Animals https://youtu.be/Ac07Qt84WDw
Confetti https://youtu.be/4JLLokZWDqE (this looks a lot better with AV1 compared to H264)

Desktop

  • OS: Windows
  • OS Version: 10
  • FreeTube version: 0.18.0

@absidue absidue marked this pull request as ready for review January 22, 2023 16:06
@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Jan 22, 2023
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) January 22, 2023 16:06
@KarateCowboy
Copy link

Tom Scott video about why YouTube's compression can't cope with snow and confetti (even though it's a 6 year old video it has AV1 formats, I wonder if YouTube used it for testing purposes): https://youtu.be/r6Rp-uo6HmI

That was very interesting. Also, very concise.

src/renderer/helpers/api/local.js Outdated Show resolved Hide resolved
src/renderer/helpers/api/local.js Show resolved Hide resolved
src/renderer/store/modules/settings.js Outdated Show resolved Hide resolved
@ChunkyProgrammer
Copy link
Member

LuanRT/YouTube.js#293

"I'm also considering adding an option to filter out unwanted formats from the DASH manifest and download function, which is why this is a WIP."

@absidue
Copy link
Member Author

absidue commented Jan 23, 2023

I considered opening a feature request for it but then realised that it's probably a pretty niche to us thing, so I just implemented it in FreeTube, however if he thinks it's going to be useful enough, then we can definitely use it.

We'll just have to hope that the filtering for the toDash function gives us a lot more control than the filtering/options that the download function uses. It's probably fine for most users of the library, that just want to download the highest quality stream without touching the formats, but we want want fine grained control.

Even with the filtering in the toDash function, we'll still need to do our own filtering, as our quality selector needs the list of adaptive formats, it'll just mean that we won't need line 620 in the Watch.js file.

@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 Jan 24, 2023
@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

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

@absidue absidue added the PR: waiting for review For PRs that are complete, tested, and ready for review label Jan 24, 2023
Copy link
Member

@ChunkyProgrammer ChunkyProgrammer left a comment

Choose a reason for hiding this comment

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

lgtm

auto-merge was automatically disabled January 25, 2023 20:59

Pull request was closed

@github-actions github-actions bot added PR: waiting for review For PRs that are complete, tested, and ready for review and removed PR: waiting for review For PRs that are complete, tested, and ready for review labels Jan 25, 2023
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) January 25, 2023 20:59
@FreeTubeBot FreeTubeBot merged commit 9d679cd into FreeTubeApp:development Jan 25, 2023
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Jan 25, 2023
@absidue absidue deleted the format-filtering branch January 25, 2023 21:01
ChunkyProgrammer pushed a commit to ChunkyProgrammer/FreeTube that referenced this pull request Jan 25, 2023
* Filter out WebM DASH formats

* Address pull request feedback
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.

6 participants