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 does not respect --audio-format if -o is used. #6724

Closed
rsd opened this issue Sep 1, 2015 · 4 comments
Closed

youtube-dl does not respect --audio-format if -o is used. #6724

rsd opened this issue Sep 1, 2015 · 4 comments

Comments

@rsd
Copy link

@rsd rsd commented Sep 1, 2015

Somewhere in the last few weeks, something changed while using the -o option.

When extracting audio, if -o is used, the audio stream is copied (mp4) even when mp3 format is what was asked for.
This does not happen if -o is ommited.

$ youtube-dl --verbose --extract-audio --audio-format mp3 -o output.mp3 https://www.youtube.com/watch?v=NUbUen66Z0k

[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'--verbose', u'--extract-audio', u'--audio-format', u'mp3', u'-o', u'output.mp3', u'https://www.youtube.com/watch?v=NUbUen66Z0k']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.08.28
[debug] Python version 2.7.9 - Linux-3.19.0-25-lowlatency-x86_64-with-Ubuntu-15.04-vivid
[debug] exe versions: avconv 11.2-6, avprobe 11.2-6, ffmpeg 2.7.2-1, ffprobe 2.7.2-1, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] NUbUen66Z0k: Downloading webpage
[youtube] NUbUen66Z0k: Downloading video info webpage
[youtube] NUbUen66Z0k: Extracting video information
[youtube] NUbUen66Z0k: Downloading DASH manifest
[youtube] NUbUen66Z0k: Downloading DASH manifest
[debug] Invoking downloader on 'https://r3---sn-bg07dnl7.googlevideo.com/videoplayback?id=3546d47a7eba6749&itag=140&source=youtube&requiressl=yes&nh=IgpwcjAxLmdydTA2Kg0xNzcuODQuMTYwLjgx&mm=35&mv=s&ms=pm&pl=24&mn=sn-bg07dnl7&ratebypass=yes&mime=audio/mp4&gir=yes&clen=17733417&lmt=1440979396118884&dur=1116.531&fexp=9406124,9408086,9408511,9408710,9409069,9413208,9415365,9415436,9415485,9416023,9416103,9416126,9416686,9417707,9417828,9418153,9418391,9418448,9419550,9420021&signature=495A189E4ACEB04F0E8F379404B9E6C021B8A4F6.0FC58A47DF97875748AC60A3459CBB1A2CB4FD53&mt=1441058097&sver=3&key=dg_yt0&upn=NFbNDS8nK78&ip=200.150.103.150&ipbits=0&expire=1441086830&sparams=ip,ipbits,expire,id,itag,source,requiressl,nh,mm,mv,ms,pl,mn,ratebypass,mime,gir,clen,lmt,dur'
[download] Destination: output.mp3
[download] 100% of 16.91MiB in 00:49
[ffmpeg] Correcting container in "output.mp3"
[debug] ffmpeg command line: avconv -y -i output.mp3 -c copy -f mp4 output.temp.mp3
[debug] avconv command line: avprobe -show_streams output.mp3
[ffmpeg] Post-process file output.mp3 exists, skipping

$ file -i output.mp3
output.mp3: video/mp4; charset=binary

------------ WITHOUT -o ---------------------
$ youtube-dl --verbose --extract-audio --audio-format mp3 https://www.youtube.com/watch?v=NUbUen66Z0k

[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'--verbose', u'--extract-audio', u'--audio-format', u'mp3', u'https://www.youtube.com/watch?v=NUbUen66Z0k']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.08.28
[debug] Python version 2.7.9 - Linux-3.19.0-25-lowlatency-x86_64-with-Ubuntu-15.04-vivid
[debug] exe versions: avconv 11.2-6, avprobe 11.2-6, ffmpeg 2.7.2-1, ffprobe 2.7.2-1, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] NUbUen66Z0k: Downloading webpage
[youtube] NUbUen66Z0k: Downloading video info webpage
[youtube] NUbUen66Z0k: Extracting video information
[youtube] NUbUen66Z0k: Downloading DASH manifest
[youtube] NUbUen66Z0k: Downloading DASH manifest
[debug] Invoking downloader on 'https://r1---sn-jv2xauxaxjvh-jfce.googlevideo.com/videoplayback?id=3546d47a7eba6749&itag=140&source=youtube&requiressl=yes&mm=31&ms=au&mn=sn-jv2xauxaxjvh-jfce&mv=m&pl=24&ratebypass=yes&mime=audio/mp4&gir=yes&clen=17733417&lmt=1440979396118884&dur=1116.531&fexp=9408710,9408988,9409069,9412514,9412913,9415365,9415436,9415485,9415521,9415992,9416023,9416105,9416126,9416330,9416729,9417014,9417707,9418153,9418199,9418448,9419338,9420019&sver=3&key=dg_yt0&signature=66080A8EFEE9E5AA5D570D006248A8D0969116D7.98C1E7DDC799DE71E78EB093A8CAADF7737FD101&mt=1441065224&upn=khG4z5YRi-A&ip=200.150.103.150&ipbits=0&expire=1441086903&sparams=ip,ipbits,expire,id,itag,source,requiressl,mm,ms,mn,mv,pl,ratebypass,mime,gir,clen,lmt,dur'
[download] Destination: Leocádio José Correia - 26 de agosto de 2015-NUbUen66Z0k.m4a
[download] 100% of 16.91MiB in 01:29
[ffmpeg] Correcting container in "Leocádio José Correia - 26 de agosto de 2015-NUbUen66Z0k.m4a"
[debug] ffmpeg command line: avconv -y -i 'Leocádio José Correia - 26 de agosto de 2015-NUbUen66Z0k.m4a' -c copy -f mp4 'Leocádio José Correia - 26 de agosto de 2015-NUbUen66Z0k.temp.m4a'
[debug] avconv command line: avprobe -show_streams 'Leocádio José Correia - 26 de agosto de 2015-NUbUen66Z0k.m4a'
[avconv] Destination: Leocádio José Correia - 26 de agosto de 2015-NUbUen66Z0k.mp3
[debug] ffmpeg command line: avconv -y -i 'Leocádio José Correia - 26 de agosto de 2015-NUbUen66Z0k.m4a' -vn -acodec libmp3lame -q:a 5 'Leocádio José Correia - 26 de agosto de 2015-NUbUen66Z0k.mp3'
Deleting original file Leocádio José Correia - 26 de agosto de 2015-NUbUen66Z0k.m4a (pass -k to keep)

$ file -i *NUbUen66Z0k.mp3
Leocádio José Correia - 26 de agosto de 2015-NUbUen66Z0k.mp3: audio/mpeg; charset=binary

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Sep 1, 2015

Forcing 'mp3' file extension confuses youtube-dl. The mp3 file is in fact m4a. Try:

$ youtube-dl --verbose --extract-audio --audio-format mp3 -o "output.%(ext)s" https://www.youtube.com/watch?v=NUbUen66Z0k
@yan12125 yan12125 closed this Sep 1, 2015
@rsd
Copy link
Author

@rsd rsd commented Sep 1, 2015

Thanks.

Can you explain that?
Why does -o is more important than --audio-format?

Regards,
-rsd

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Sep 1, 2015

With -o output.mp3, the downloaded file is named as output.mp3. youtube-dl thinks it's already an mp3, so no conversion occurs.

@alexmercerind
Copy link

@alexmercerind alexmercerind commented Sep 14, 2020

This stack overflow helped me.

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.