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

youtube-dl ignores --audio-quality option when extracting certain songs to Vorbis (.ogg) at a high bitrate #16524

Closed
ghost opened this issue May 22, 2018 · 5 comments

Comments

@ghost
Copy link

@ghost ghost commented May 22, 2018

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2018.05.18. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2018.05.18

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add the -v flag to your command line you run youtube-dl with (youtube-dl -v <your command line>), copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

[debug] System config: [u'--prefer-ffmpeg', u'-x', u'--audio-format', u'vorbis', u'--audio-quality', u'320k', u'--no-mtime']
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-x', u'--audio-format', u'vorbis', u'--audio-quality', u'320k', u'https://www.youtube.com/watch?v=bGqFtiyqB_E']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.05.18
[debug] Python version 2.7.13 (CPython) - Linux-4.9.0-6-amd64-x86_64-with-debian-9.4
[debug] exe versions: avconv 4.0-2, avprobe 4.0-2, ffmpeg 4.0-2, ffprobe 4.0-2, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] bGqFtiyqB_E: Downloading webpage
[youtube] bGqFtiyqB_E: Downloading video info webpage
[youtube] bGqFtiyqB_E: Extracting video information
[youtube] {43} signature length 43.42, html5 player vflXIriOh
[youtube] {18} signature length 43.42, html5 player vflXIriOh
[youtube] {36} signature length 43.42, html5 player vflXIriOh
[youtube] {17} signature length 43.42, html5 player vflXIriOh
[youtube] {135} signature length 43.42, html5 player vflXIriOh
[youtube] {244} signature length 43.42, html5 player vflXIriOh
[youtube] {134} signature length 43.42, html5 player vflXIriOh
[youtube] {243} signature length 43.42, html5 player vflXIriOh
[youtube] {133} signature length 43.42, html5 player vflXIriOh
[youtube] {242} signature length 43.42, html5 player vflXIriOh
[youtube] {160} signature length 43.42, html5 player vflXIriOh
[youtube] {278} signature length 43.42, html5 player vflXIriOh
[youtube] {140} signature length 43.42, html5 player vflXIriOh
[youtube] {171} signature length 43.42, html5 player vflXIriOh
[youtube] {249} signature length 43.42, html5 player vflXIriOh
[youtube] {250} signature length 43.42, html5 player vflXIriOh
[youtube] {251} signature length 43.42, html5 player vflXIriOh
[debug] Invoking downloader on u'https://r6---sn-j5caxoxu-hh0e.googlevideo.com/videoplayback?ipbits=0&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpcm2cms%2Cpl%2Crequiressl%2Csource%2Cexpire&keepalive=yes&requiressl=yes&dur=248.800&id=o-AN5yiQm7Re645JpGw5bmJBn1nc3DKc8XKLDXRC24LyOH&mm=31%2C29&mn=sn-j5caxoxu-hh0e%2Csn-ab5l6nsk&pcm2cms=yes&key=yt6&ip=[redacted]&lmt=1449810723711384&ms=au%2Crdu&fvip=6&source=youtube&mv=m&pl=22&ei=6kIEW5ReiriGBu_rgvgI&expire=1527027530&clen=3998849&gir=yes&mime=audio%2Fwebm&c=WEB&initcwndbps=1535000&mt=1527005857&itag=171&signature=02FAFA03C07478EA92BFBC0484611E2C60DF8C3D.6882B3A1EC51216D93D45FB6245D4713146D92A7&ratebypass=yes'
[download] Destination: quest - rerulili feat.GUMI_クエスト-  れるりりfeat.GUMI-bGqFtiyqB_E.webm
[download] 100% of 3.81MiB in 00:00
[debug] ffmpeg command line: ffprobe -show_streams 'file:quest - rerulili feat.GUMI_クエスト-  れるりりfeat.GUMI-bGqFtiyqB_E.webm'
[ffmpeg] Destination: quest - rerulili feat.GUMI_クエスト-  れるりりfeat.GUMI-bGqFtiyqB_E.ogg
[debug] ffmpeg command line: ffmpeg -y -i 'file:quest - rerulili feat.GUMI_クエスト-  れるりりfeat.GUMI-bGqFtiyqB_E.webm' -vn -acodec copy 'file:quest - rerulili feat.GUMI_クエスト-  れるりりfeat.GUMI-bGqFtiyqB_E.ogg'
Deleting original file quest - rerulili feat.GUMI_クエスト-  れるりりfeat.GUMI-bGqFtiyqB_E.webm (pass -k to keep)
...
<end of log>

Description of your issue, suggested solution and other information

When using youtube-dl to extract audio from certain YouTube videos, youtube-dl will ignore / not respect the --audio-quality option when extracting to a Vorbis (.ogg) file at a high bitrate such as 320k. The video shown in the log extracts as 128k instead, forcing me to use other sites / utilities to extract at the desired bitrate. The issue does not impact extracting to .mp3

youtube-dl should always respect / enforce the specified quality regardless of format.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented May 22, 2018

  1. --audio-format is a conversion option that is only used when source and --audio-format codecs are different.
  2. Using --audio-quality 320k is pointless for Youtube since it does not serve 320 not even 192. With --audio-quality you'll just upconvert this 128k vorbis to 320k that won't make it sound any better.
@dstftw dstftw closed this May 22, 2018
@ghost
Copy link
Author

@ghost ghost commented May 22, 2018

Wouldn't upconverting help minimize generation loss (lossy encoding on an already lossy source) when converting from the video though? Or do I have some horrible misunderstanding of how audio is extracted? No reason not to have it, I mean, by that logic, why even have audiophile options like FLAC or WAV as an available format?

More importantly, why does it respect the option with some videos but not others if it's not beneficial / relevant / possible? And why does it always respect it when using MP3 as the format?

It doesn't make sense to me.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented May 22, 2018

It does not convert from the video for Youtube in the first place. It downloads separate audio format and converting from it if necessary.

why even have audiophile options like FLAC or WAV as an available format?

Cause there may be such formats for other extractors.

More importantly, why does it respect the option with some videos but not others if it's not beneficial / relevant / possible?

I've already pointed that out.

And why does it always respect it when using MP3 as the format?

No, it does not. It won't convert if source is mp3. Again read my first post.

@ghost
Copy link
Author

@ghost ghost commented May 22, 2018

So to make sure I got this straight. The audio portion of a YouTube video is a separate file / embedded stream with its own format that can vary from video to video; and if said format matches my preferred format, then it just copies it directly as that file without any additional encoding that would introduce any further loss?

Meaning that when it "works" a conversion from whatever format it was, was necessary; and only in those cases I'm guessing further loss is introduced if I want my entire library in open (patent free) formats?

Sorry for the headache, I'm just trying to wrap my mind around this. My original understanding was that it had to decode and re-encode regardless.

@ghost
Copy link
Author

@ghost ghost commented May 24, 2018

Can you tell me if I understand you correctly now?

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
1 participant
You can’t perform that action at this time.