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

Audio bitrate never over 128K #3586

Closed
esadovnik opened this issue Aug 25, 2014 · 5 comments
Closed

Audio bitrate never over 128K #3586

esadovnik opened this issue Aug 25, 2014 · 5 comments

Comments

@esadovnik
Copy link

@esadovnik esadovnik commented Aug 25, 2014

Hi. I'm a Windows user with ffmpeg installed, and I'd like to use youtube-dl to batch download a bunch of audio files at a bitrate of 160kbps and convert them to mp3's from time to time. I use:

"youtube-dl -x --audio-quality 160K [URL]"

but it only ever downloads a 128kbps file (and this is from YT videos on which I'm almost sure the bitrate is above 128kbps). I've also tried:

"youtube-dl -x --audio-format mp3 --audio-quality 160K [URL]"

and this outputs a 160kbps mp3 file, but it is simply upscaled -- using a spectrum analyzer (specifically, Spek), I see that the bitrate is actually 128kbps. Does anyone know why is this happening, and/or how I get around it?

@phihag
Copy link
Contributor

@phihag phihag commented Aug 25, 2014

What makes you think that the audio file is available in the first place at 160 KBit/s? Can you name the URL you're downloading?

@esadovnik
Copy link
Author

@esadovnik esadovnik commented Aug 25, 2014

The audio file I wanted to download I was pretty sure was at least 160kbps, but when I ran into the problem, I wanted to check it, so I went to this video:

https://www.youtube.com/watch?v=C5r3uCKFAls

It bills itself as a test audio file with a 320kbps bitrate, and I still can't download a version of it that is above 128kbps.

Additionally, the video claims that the audio file used in it is 5.94 MB, but the audio file I download is 3.7 MB.

@phihag
Copy link
Contributor

@phihag phihag commented Aug 25, 2014

These values refer to the original file, but YouTube is always reencoding them, so you can't expect to get 320 kbps back. However, you are right that apparently youtube-dl does not find all formats. We should enable DASH manifest download.

As a workaround, try passing in the --youtube-include-dash-manifest option.

@esadovnik
Copy link
Author

@esadovnik esadovnik commented Aug 26, 2014

Thanks! It works now!

@esadovnik esadovnik closed this Aug 26, 2014
@mygazztop
Copy link

@mygazztop mygazztop commented Jul 18, 2019

Hello. I have the same problem. The difference is that I use Python. When I download audio from YouTube, it is downloaded at 128 kbps, although it is higher on YouTube. This is my code:

from __future__ import unicode_literals
import youtube_dl
url = 'https://www.youtube.com/watch?v=C5r3uCKFAls'
ydl_opts = {
    'format': 'bestaudio/best',
    'postprocessors': [{
        'key': 'FFmpegExtractAudio',
        'preferredcodec': 'mp3',
    }],
}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
    ydl.download([url])

Of course I can add a line 'preferredquality': '320', but it will not be a real quality. How can I solve my problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.