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

--extract-audio doesn't seem to work. #87

Closed
bat999 opened this issue Feb 27, 2011 · 14 comments
Closed

--extract-audio doesn't seem to work. #87

bat999 opened this issue Feb 27, 2011 · 14 comments

Comments

@bat999
Copy link

bat999 commented Feb 27, 2011

Hi
I've tried using the --extract-audio option.
What happens is a new file is created 'whatever.aac' but it contains 0 bytes and the downloaded flv file gets deleted.
Am I using it correctly?
youtube-dl --extract-audio http://www.youtube.com/watch?v=2bQZ6l_cq5Y&feature=feedrec_grec_index

Version is 2011.02.25c
Ubuntu 9.10
FFmpeg version git-2bbec1e

@rg3
Copy link
Collaborator

rg3 commented Feb 27, 2011

I don't know what could be wrong. youtube-dl is supposed not to delete the video if ffprobe or ffmpeg fail to run or exit with error. I'd try the following:

  • Use youtube-dl to download the video normally.
  • Then, run "ffmpeg -y -i VIDEO_FILE -vn -acodec copy -f adts -- FILE.aac"
  • Then, run "echo $?" (this will print the exit status of ffmpeg).

Take note of the ffmpeg output and its exit status, so we can investigate what goes wrong in the process.

@bat999
Copy link
Author

bat999 commented Feb 27, 2011

Hi
Yes, I've extracted the aac from a downloaded video as per your command above.
When I enter echo $? this is the reply:-
ron@ubuntu:~$ echo $?
0

@rg3
Copy link
Collaborator

rg3 commented Feb 27, 2011

If that works, youtube-dl should work too, because that's the exact same command youtube-dl tries to run when extracting the audio from the video file. I just tried locally here, and I get:

-rw------- 1 rg3 users 3549345 Feb 27 17:46 2bQZ6l_cq5Y.aac

@bat999
Copy link
Author

bat999 commented Feb 27, 2011

Yes, I also have the file 2bQZ6l_cq5Y.aac.
But it is empty, zero bytes.

@rg3
Copy link
Collaborator

rg3 commented Feb 27, 2011

I'll think about it a bit more and maybe I'll post some special version of the program to get more information. In the mean time, I suspect a very weird problem. If ffmpeg failed to run for some reason, the file wouldn't even be created. The fact that it exists and has zero bytes signals a very very strange problem. I don't know what could be wrong right now.

@rg3
Copy link
Collaborator

rg3 commented Feb 27, 2011

This version will print the ffmpeg command, and will not redirect its output, so you can see what ffmpeg is doing:

https://gist.github.com/baf002a3049c7861d2f2

@bat999
Copy link
Author

bat999 commented Feb 27, 2011

OK thanks.
But the 2bQZ6l_cq5Y.aac file that you have, is it not zero bytes too?

@bat999
Copy link
Author

bat999 commented Feb 27, 2011

I've pasted the terminal output.
ffmpeg started to convert, then it just hung there doing nothing:-
Press [q] to stop encoding

Here is the output:- http://pastebin.com/aPpRxPc3

@rg3
Copy link
Collaborator

rg3 commented Feb 27, 2011

I think you're confused. As you did not quote the URL, the shell interpreted the command as something to be launched in the background. The process probably finished, but you don't see the prompt appear.

@rg3
Copy link
Collaborator

rg3 commented Feb 27, 2011

About your previous question, no, my AAC file is not empty. I pasted the "ls -l" in a comment above.

@bat999
Copy link
Author

bat999 commented Feb 27, 2011

"As you did not quote the URL"
Please explain what this means.

My command was:-
ron@ubuntu:~$ ./tester --extract-audio http://www.youtube.com/watch?v=2bQZ6l_cq5Y&feature=feedrec_grec_index

The URL is included there:-
"http://www.youtube.com/watch?v=2bQZ6l_cq5Y&feature=feedrec_grec_index"

What do you mean?

@rg3
Copy link
Collaborator

rg3 commented Feb 27, 2011

I mean to put the URL in quotes, as in:

./tester --extract-audio 'http://www.youtube.com/watch?v=2bQZ6l_cq5Y&feature=feedrec_grec_index'

@bat999
Copy link
Author

bat999 commented Feb 27, 2011

Hi
Yes, the command does work properly when I enclose the URL in quotes.
That's the solution.

My excuse is that when I do normal downloads it's not necessary to use quotes. ;-)

Thanks for your patience.

@rg3
Copy link
Collaborator

rg3 commented Feb 27, 2011

No problem, I'm closing the issue since it's a non-issue.

joedborg referenced this issue in joedborg/youtube-dl Nov 17, 2020
[pull] master from rg3:master
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants