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

Closed
opened 2026-02-20 21:01:06 -05:00 by deekerman · 14 comments
Owner

Originally created by @bat999 on GitHub (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

Originally created by @bat999 on GitHub (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
Author
Owner

@rg3 commented on GitHub (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.

@rg3 commented on GitHub (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.
Author
Owner

@bat999 commented on GitHub (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

@bat999 commented on GitHub (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
Author
Owner

@rg3 commented on GitHub (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
@rg3 commented on GitHub (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 ```
Author
Owner

@bat999 commented on GitHub (Feb 27, 2011):

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

@bat999 commented on GitHub (Feb 27, 2011): Yes, I also have the file 2bQZ6l_cq5Y.aac. But it is empty, zero bytes.
Author
Owner

@rg3 commented on GitHub (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 commented on GitHub (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.
Author
Owner

@rg3 commented on GitHub (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

@rg3 commented on GitHub (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
Author
Owner

@bat999 commented on GitHub (Feb 27, 2011):

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

@bat999 commented on GitHub (Feb 27, 2011): OK thanks. But the 2bQZ6l_cq5Y.aac file that you have, is it not zero bytes too?
Author
Owner

@bat999 commented on GitHub (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

@bat999 commented on GitHub (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
Author
Owner

@rg3 commented on GitHub (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 commented on GitHub (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.
Author
Owner

@rg3 commented on GitHub (Feb 27, 2011):

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

@rg3 commented on GitHub (Feb 27, 2011): About your previous question, no, my AAC file is not empty. I pasted the "ls -l" in a comment above.
Author
Owner

@bat999 commented on GitHub (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?

@bat999 commented on GitHub (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?
Author
Owner

@rg3 commented on GitHub (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'
@rg3 commented on GitHub (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' ```
Author
Owner

@bat999 commented on GitHub (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.

@bat999 commented on GitHub (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.
Author
Owner

@rg3 commented on GitHub (Feb 27, 2011):

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

@rg3 commented on GitHub (Feb 27, 2011): No problem, I'm closing the issue since it's a non-issue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl#61
No description provided.