-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
new option to extract as mp3? is this possible? #2
Comments
Originally by "obeythepenguin": youtube-dl just downloads the raw video file; there's no conversion. However, there are some front-ends that can do conversion. I'm developing one called youtube2mp3 ( http://youtube2mp3.sourceforge.net/ ), although I don't use a Mac so I don't know how well it works on OS X. There are, of course, plenty of others. |
The internal code in youtube-dl allows for postprocessing, so anybody can implement a postprocessor to extract the audio from the video file using an external tool (like obeythepenguin said, youtube-dl just downloads the raw video file without looking at its internal format). I'd gladly merge that code into the program if someone is willing to maintain that part. I haven't implemented any postprocessing yet because I don't postprocess any video. I'm leaving the issue open just in case someone wants me to merge it. |
Originally by "rmunn": In the meantime, one easy way to extract the audio from a downloaded video file is to use Audacity (http://audacity.sourceforge.net/). Open the .mp4 in Audacity and it will automatically extract the audio for you -- then just do File -> Export and save it as an .mp3. (Remember to download the LAME DLL for Audacity so it can save MP3's, of course (see http://audacity.sourceforge.net/help/faq?s=install&item=lame-mp3 for details). |
Originally by anonymous: ffmpeg.exe -i My_Chemical_Romance_-_Famous_Last_Words.flv famous_last_word.mp3 via http://www.catonmat.net/blog/how-to-extract-audio-tracks-from-youtube-videos/ |
Originally by anonymous: And add -ab parameter to ffmpeg to set the audio bitrate (default is 64k). ffmpeg -ab 192k -i <input.file> <output.file> |
Originally by anonymous: Or with mplayer: $ mplayer -dumpaudio -dumpfile out.mp3 Maybe to add a generic postprocessor that calls external programs like mplayer, ffmpeg or what ever. The command should also accept "variables" similar to the litteral titel formating rules, e.g $ youtube-dl http://www.youtube.com/watch?v=foobar -i "mplayer -dumpaudio %(filename)s -dumpfile %(title)s.mp3" Maybe it is just the work of adding some lines to the program ... Alex |
I've written a program (PC) to extract an mp3 from the video file. If anyone is interested email me lx5415@gmail.com |
The issue tracker is no place for promoting your own software. mplayer can trivially extract the audio from the video file, and it works on many platforms. The issue at hand here is if someone is willing to code a postprocessor that uses it, or other software, to extract the MP3 and integrate it with youtube-dl. |
i forgot to mention that it is free and open and it uses youtube_dl. I am in no way trying to sell anything. I am just trying to contribute to the open source community. This may or may not be warranted in this forum. Sorry! |
https://github.com/chrisbra/youtube2audio uses youtube-dl or clive to extract videos from youtube and convert it to mp3 or ogg. Christian |
Hi simple implementation can be found at https://github.com/dz0ny/YoutubeDl-Server |
I'd loved to see an option that rg3 suggested that calls a given program with the downloaded file after succesful download. I automatically download some videos every day but want to reencode them at night for my Android phone with optimal settings and this would be very easy using such an option. I think i'll implement it by myself and let you know if it works. |
Implement class then add again see my project, for more complete example https://github.com/dz0ny/YoutubeDl-Server/blob/master/youtubedl-server.py |
dz0ny, Why don't you clean that part of the code a little bit, avoid the command injection problem and submit a postprocessor to be integrated with the program, activated by a command line switch? That way every youtube-dl user would benefit from the postprocessor. |
@rg3 would something like this, be sufficient?
|
@dz0ny I would rather also like to be able to call a costum command with the downloaded file like -i COMMAND, --excecute=COMMAND I think this would be more flexible as everyone can call his own commands (e.g., not only for transcoding but to schedule other events on downloaded files, e.g., movement etc). I need it because I would like to be able to do two pass encodings which would not be possible with your single ffmpeg transcode command. But the -T option should still be usefull in many situations. |
B.t.w. yesterday I implemented my transcoder event as a postprocessor sucessfully in youtube-dl. However, I realized that the postprocessors are also called on already existing files due to the success state "True": self.report_file_already_downloaded(filename) and for my application it made more sense to mark already downloaded files as not successful to not make the transcoder work on that file again. |
Hi just quick thought how about Post download action: or implement command chaining -T mp4 --transcode_extra ... -T mkv --transcode_extra ... |
Check https://github.com/dz0ny/youtube-dl
|
Custom commands can be a good thing but they can't replace extracting the audio from the video file in the form of a simple option that would call mencoder or ffmpeg to losslessly dump the audio stream to a file, then delete the original video, all by itself. Dumping the audio stream could have an extra option to choose if you want to preserve the original format, or force it to be in MP3 or AAC, losslessly when possible. For example, I can run the following command in the example above:
Knowing it's in AAC lets me run:
And get:
Which is the original audio in MPEG v4 container, playable by many portable devices. I think people interested in this bug would like such a feature to do all this work automatically for them. |
I think such feature as you describe(everything done automatically) is for people who use GUI applications, those who use CLI tools prefer more options and more control over the process. BUT most transcoders have presents for devices or user-cases, have a look for example Handbrake https://trac.handbrake.fr/wiki/BuiltInPresets. I would propose something like -T ipad --preserve-original --strip-video, maybe we could use handbrake for this and not ffmpeg? How is support for ffmeg on OSX? Is Handbrake better choice for this, because is multiplatform and has solid codebase (ffmpeg is in some distributions stripped of proprietary codecs)? For other user cases "Custom commands" are must for such tool, as youtube-dl is. |
Your -C COMMAND, --command=COMMAND option works great, thanks, just what I needed. Now I check for an already downloaded file by myself in the called script to not recode an already coded file once again. |
Just to note -C has following replaceble variables
|
Those wanting so much "control over the process" can script something outside youtube-dl. |
Add an audio extracting PostProcessor using ffmpeg (closed by 3072fab) |
Sometimes, video files will arrive with a timecode data stream that causes `-map 0` to error out due to the stream not being supported in the output container. These data streams generally do not matter, so tell ffmpeg to ignore them rather than choking on them.
closes ytdl-org#2, blackjack4494#291 Authored by jbruchon
Merge ytdl-org up to date
Was: http://bitbucket.org/rg3/youtube-dl/issue/83/
Hi there thanks for the program!
is it possible to have an option to extract the youtube video as mp3s?
I am using a mac btw and i love ur program on my terminall
The text was updated successfully, but these errors were encountered: