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-quality not working as intended #487

Closed
dspstudio opened this issue Oct 23, 2012 · 6 comments
Closed

--audio-quality not working as intended #487

dspstudio opened this issue Oct 23, 2012 · 6 comments

Comments

@dspstudio
Copy link

@dspstudio dspstudio commented Oct 23, 2012

Hello,
I'm using the following command to download video and convert it into mp3:

youtube-dl -t --extract-audio --audio-format mp3 --audio-quality 256k --max-quality 37 http://www.youtube.com/watch?v=xxxxxxxxx

The problem i have is that every mp3 has 128kbs compression ratio. Before the latest update (youtube and youtube-dl) worked flawlessly.
I tried every command without success, if i miss the quality it gets the mp3 at 28kbs.
i tried even downloading same video that worked before.

Ubuntu server 12 with Python 2.7.3

@Tailszefox
Copy link
Contributor

@Tailszefox Tailszefox commented Oct 23, 2012

I can confirm this, at least with ffmpeg as I don't have a binary of avconv handy, and I think I found the issue: the "k" is stripped from the quality parameter when it's sent to ffmpeg, and since it's nonsensical (ffmpeg outputs the warning The bitrate parameter is set too low. It takes bits/s as argument, not kbits/s), it defaults to 128k. I'm thinking the issue would be the same with avconv, looking at the man page, but I can't confirm it, so if anyone else uses avconv, that could be useful to confirm.

@FiloSottile
Copy link
Collaborator

@FiloSottile FiloSottile commented Oct 23, 2012

Without --audio-quality it should go VBR at quality 5, doesn't it?

@Tailszefox
Copy link
Contributor

@Tailszefox Tailszefox commented Oct 23, 2012

Yep, without --audio-quality it assumes VBR at quality 5 according to this line. In this particular case though the argument -b:a 256 is passed to ffmpeg, which is then interpreted as meaning a bitrate of 256bits/s, which isn't valid. That's why adding a k is necessary in this case.

@FiloSottile
Copy link
Collaborator

@FiloSottile FiloSottile commented Oct 23, 2012

Yep, yep, I got that part (my fault), I was referring to "if i miss the quality it gets the mp3 at 28kbs"

@Tailszefox
Copy link
Contributor

@Tailszefox Tailszefox commented Oct 23, 2012

Oh, right, my bad, I didn't understand you were referring to that part! From my tries it definitely seems to work as intended without the option, as I get the same file when I leave out the option and when I set it to 5. Since it's variable though it may depend on the original file and what tool is used to see the bitrate of it. In this case I would guess @tuteezy made a typo and meant that it produces a file with a VBR of _1_28kpbs, which seems like a possible number (at least one I can get when I have a look at the output of ffplay for example).

@FiloSottile
Copy link
Collaborator

@FiloSottile FiloSottile commented Oct 24, 2012

I noticed strangely low bitrates when encoding in VBR, too. Now I got it: audio in .flv is mono, so with VBR the bitrate will be half what you expect from a given quality factor. One more reason to use VBR. (Then, 28kbps is so low that it is probably a typo)

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.

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