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

[Bug]: Audio cut up to 16 KHz #4294

Closed
5 of 6 tasks
castillofrancodamian opened this issue Nov 7, 2023 · 5 comments
Closed
5 of 6 tasks

[Bug]: Audio cut up to 16 KHz #4294

castillofrancodamian opened this issue Nov 7, 2023 · 5 comments
Labels
B: data loss bug Something isn't working

Comments

@castillofrancodamian
Copy link
Contributor

castillofrancodamian commented Nov 7, 2023

Guidelines

  • I have encountered this bug in the latest release of FreeTube.
  • I have encountered this bug in the official downloads of FreeTube.
  • I have searched the issue tracker for open and closed issues that are similar to the bug report I want to file, without success.
  • I have searched the documentation for information that matches the description of the bug I want to file, without success.
  • This issue contains only one bug.

Describe the bug

In all the videos I play I hear that the audio is clipped at 16 KHz, as if it were a 128 Kbps mp3, but when playing the video in Chrome or Firefox, the audio reaches 20 KHz. I can tell by listening to and recording desktop audio with Audacity and then viewing the spectrum with Spek.

Expected Behavior

I hope FreeTube plays the entire audio spectrum.

Issue Labels

data loss

FreeTube Version

0.19.1-nightly-3611

Operating System Version

Linux pc 6.5.9-arch2-1 #1 SMP PREEMPT_DYNAMIC Thu, 26 Oct 2023 00:52:20 +0000 x86_64 GNU/Linux

Installation Method

.AppImage

Primary API used

Invidious API

Last Known Working FreeTube Version (If Any)

No response

Additional Information

No response

Nightly Build

@castillofrancodamian castillofrancodamian added the bug Something isn't working label Nov 7, 2023
@castillofrancodamian castillofrancodamian changed the title Audio cut up to 16 KHz [Bug]: Audio cut up to 16 KHz Nov 7, 2023
@efb4f5ff-1298-471a-8973-3d47447115dc

Could u you send examples of this we suspect it is probably because YouTube normalises the audio at runtime whereas FreeTube plays the file as is or AAC vs OPUS

if it's aac vs opus could you test the audio formats with the highest quality

@castillofrancodamian
Copy link
Contributor Author

@efb4f5ff-1298-471a-8973-3d47447115dc I don't think it's because of the audio normalization because that's just the volume, not a frequency cut. The quality is at 1080p. The audio codec is not mentioned anywhere in the app.

@absidue
Copy link
Member

absidue commented Nov 7, 2023

Right click and turn on the stats, on YouTube they are called stats for nerds and are available in the right click menu too.

FreeTube can only use the m4a/aac audio format during DASH playback (limitation of the player library we are using, it only supports MP4 DASH, not WebM DASH), YouTube uses the OPUS formats.

To check if it's a difference between the opus vs m4a/aac formats, you can switch to the audio formats in FreeTube, either by using the Change Media Formats button on the watch page or changing the default in the Player Settings in the settings and run your tests again.

@castillofrancodamian
Copy link
Contributor Author

castillofrancodamian commented Nov 7, 2023

The only way to get better audio quality without frequency cutting is to use the option to use audio formats, but you cannot see the video.

@absidue
Copy link
Member

absidue commented Nov 7, 2023

Yes that is correct, in audio only mode, you only have audio. The reason we are able to provide the opus formats with that, is because audio and video are split into separate files on YouTube (the only exception are the legacy formats, but those are only available in 360p and 720p with even lower audio quality). In audio-only mode we only have to play a single file, which is natively supported by browsers. During DASH playback you need to combine both an audio and a video file at play time, which is not natively supported by web browsers, so that has to be handled entirely in JavaScript and then passing the raw combined data to browser.

The video player we use, video.js, the same one that Invidious uses too, only supports MP4 DASH. YouTube only provides their higher quality opus formats in WebM files, so they can only be used for audio-only mode, where the entire playback is handled directly by the browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B: data loss bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants