Take the audio from a youtube video

前端 未结 2 967
南旧
南旧 2020-12-23 23:42

Is it possible to retrieve only the audio from a youtube video using the java youtube api?

相关标签:
2条回答
  • 2020-12-24 00:04
    sudo apt-get install youtube-dl ffmpeg libavcodec-extra-53 libav-tools
    
    youtube-dl -x --audio-format mp3 --audio-quality 4 http://youtu.be/oRJ0FaOIIbM 
    
    0 讨论(0)
  • 2020-12-24 00:09

    Very similar to How do I programmatically extract the audio from a YouTube video?.

    The top answer there is:

    Writing an application for this might be overkill. Existing tools already do a pretty good job, and it's hard to beat their simplicity:

    wget http://www.youtube.com/get_video.php?video_id=...
    

    | ffmpeg -i - audio.mp3

    All done!

    If your application needs to do something special with the audio afterwards, it would make sense to write an app for that part. But for just getting the audio out, shelling out to ffmpeg will be a lot easier.

    Kudos to John Feminella for the answer.

    0 讨论(0)
提交回复
热议问题