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

Extracting the audio from a download. #1470

Closed
ghost opened this issue Sep 21, 2013 · 6 comments
Closed

Extracting the audio from a download. #1470

ghost opened this issue Sep 21, 2013 · 6 comments

Comments

@ghost
Copy link

@ghost ghost commented Sep 21, 2013

When extracting the audio from a downloaded video, e.g.

youtube-dl [link] --extract-audio --audio-format mp3 "[title].mp3"

The video is still there when playing the audio in VLC, and subsequently the file won't play in iTunes. Is this intended, and is there no way to remove the video entirely?

@phihag
Copy link
Contributor

@phihag phihag commented Sep 21, 2013

Mmm, all of these work perfectly fine with me (assuming the "stuck music effect" at the start of these songs is intentional). What output do you get for ffmpeg --version? Also, can you post one entire command line verbatim? The above will fail, because "[title].mp3" is not a valid URL.

@phihag
Copy link
Contributor

@phihag phihag commented Sep 21, 2013

I have a hunch: Did you call something like

youtube-dl  LSui54Xm-wA -x --audio-format mp3 -o '%(title)s.mp3'

? This won't work, since the video filename is the same as the audio filename. It should result in the youtube-dl output

[youtube] Post-process file TNGH T - Higehr Gruond.mp3 exists, skipping

but no other warning.

To get the desired behavior, simply use %(ext)s instead:

youtube-dl  LSui54Xm-wA -x --audio-format mp3 -o '%(title)s.(ext)s'

youtube-dl versions after 2013.09.20.1 will raise an error to that effect if you forget (ext)s.

I'm marking this issue as closed now since I believe that to be the problem, and it fits perfectly with your symptoms, i.e. you'll get the video file with audio instead of just an audio file. If that isn't the case, please comment and we'll reopen this issue. Thanks for reporting!

@phihag phihag closed this Sep 21, 2013
@vanilla38
Copy link

@vanilla38 vanilla38 commented Sep 24, 2013

since this commit i cant download:
sudo youtube-dl URL --audio-format=mp3 --extract-audio -o randomname.mp3

i automatically get the error message liste above

@phihag
Copy link
Contributor

@phihag phihag commented Sep 24, 2013

@vanilla38 Well, that's because the output format is wrong and cannot work this way. And don't call youtube-dl with sudo (unless you've installed it system-wide, and you're updating), that's a very bad idea!

Your invocation is wrong, use %(ext)s, like this:

youtube-dl BaW_jenozKc --audio-format=mp3 --extract-audio -o 'randomname.%(ext)s'
@vanilla38
Copy link

@vanilla38 vanilla38 commented Sep 24, 2013

thanks alot yea i just tested it manually but command is usually sent by php so no sudo ^^.

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