question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Audio downloaded with conversion is capped at 160kbps bitrate

See original GitHub issue

Version

6.2.4

Details

YouTube Video Link: https://www.youtube.com/watch?v=g6jK6blyPc4

I get an 237kbps webm audio stream but when I download it the file properties show it as 160kbps.

I guess this a limitation from YouTube but how do I even get this 237kbps stream in the first place?

Steps to reproduce

Get the stream: var audioStream = manifest.GetAudioOnlyStreams().First(x => (int)x.Bitrate.KiloBitsPerSecond == kbpsBitrate);

Download it (Tried saving as webm and mp3):

await Videos.DownloadAsync(fullStream, new ConversionRequestBuilder($"{filePathAndTitle}.{(onlyAudio ? ".mp3" : ".mp4")}")
                .SetFFmpegPath(FFmpegPath).SetPreset(ConversionPreset.UltraFast).SetContainer(onlyAudio ? "mp3" : "mp4").Build(),
                new Progress<double>(x => progress(x)), _cts.Token);

See in file properties only 160kbps bitrate

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
BlyZeYTcommented, Nov 8, 2022

Interesting, maybe they raised it.

If you download the stream without conversion (i.e. not through YoutubeExplode.Converter), does the player still show 237kbps?

When I download only the audio stream without conversion the bitrate is the same

0reactions
Tyrrrzcommented, Feb 6, 2023

I think what might be happening is that FFmpeg converts the media from constant bitrate to variable bitrate, to reduce file size while keeping quality more or less lossless.

As for this:

When I do it like this I get 224kbps instead of 237kbps xD

It might be because FFmpegCore and YoutubeExplode counts units differently (1024 bytes in kilobyte vs 1000)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Audio bitrate capped at 160kbps / Low audio quality
I've noticed while using OBS-MP that it seems like the audio quality is lower when compared to the regular OBS.
Read more >
Does it make sense converting a file to a higher audio ...
Yes, it might actually make sense if you are being forced to change formats. If you have a file with 95kbps in a...
Read more >
Do you think YouTube will ever upgrade audio quality for ...
I'm guessing they won't and will be capped at 128kbps-160kbps. YouTube itself would have to change things to support higher bitrates.
Read more >
How to choose the right bitrate for your stream (2020 Update)
Generally speaking, audio bitrate is locked in at 160 kbps while streaming, ... but your internet speed is measured in Mbps. The conversion...
Read more >
Bit Rates - iPod and iTunes: The Missing Manual, Third ...
For example, an MP3 file encoded at 160 Kbps sounds a heck of a lot better than one recorded at 96—but it takes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found