从YouTube视频下载只有音频 [英] Download ONLY audio from a youtube video

查看:804
本文介绍了从YouTube视频下载只有音频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道有一百万的方式从YouTube下载的视频,然后将其转换为音频或在其上做进一步的处理。但最近我很惊讶地看到在Mac上居然显示跳过视频的X- MB,也应该只下载从视频中的音频称为YoutubeToMp3一个应用程序,而不需要使用带宽来下载整个视频,然后将其转换。我想知道,如果这确实是正确的,并有可能的话,因为我找不到任何方式做到这一点。你有什么想法?

I know that there are a million ways to download a video from youtube and then convert it to audio or do further processing on it. But recently I was surprised to see an app called YoutubeToMp3 on mac actually showing "Skipping X mb of video" and supposedly only downloading the audio from the video, without the need to use bandwith to download the entire video and then convert it. I was wondering if this is actually correct and possible at all because I cant find any way to do that. Do you have any ideas ?

编辑:
一些测试后在这里是对主题的一些附加信息。我试图从获得的音频视频只是从互联网上一个样本MP4文件:

After some tests here is some additional information on the topic. The video which I tried to get the audio from is just a sample mp4 file from the internet:

<一个href=\"http://download.wavetlan.com/SVV/Media/HTTP/MP4/ConvertedFiles/Media$c$cr/Media$c$cr_test6_1m9s_XVID_VBR_306kbps_320x240_25fps_MPEG1Layer3_CBR_320kbps_Stereo_44100Hz.mp4\">http://download.wavetlan.com/SVV/Media/HTTP/MP4/ConvertedFiles/Media$c$cr/Media$c$cr_test6_1m9s_XVID_VBR_306kbps_320x240_25fps_MPEG1Layer3_CBR_320kbps_Stereo_44100Hz.mp4

我试过

的ffmpeg -i输入out.mp3

的ffmpeg -i输入-vn out.mp3

的ffmpeg -i输入-vn -ac-AR 44100-AB 320K的mp3 -f output.mp3

的ffmpeg -i输入-vn -a codeC副本output.mp3

不幸的是这些命令的非似乎是使用较少的带宽。他们都下载整个视频。现在,你有视频可以为您确认是否确实是存在的,从它只能下载音频流,降低了带宽使用率的命令?谢谢!

Unfortunately non of these commands seems to be using less bandwith. They all download the entire video. Now that you have the video can you confirm if there is actually a command that downloads only the audio stream from it and lowers the bandwith usage? Thanks!

推荐答案

了大量的研究,我发现这是不可能的,开发商的另一种方法之后:

After a lot of research I found out this is not possible and developer an alternative approach:


  1. 下载MP4标题

  2. 解析头,并获得音频字节的位置

  3. 以http请求的范围和偏移下载音频字节

  4. 组装音频字节,敷在他们简单的ADTS容器制作一个播放M4A文件

这种方式仅用于音频字节的带宽。如果你发现做的更好的方法是请让我知道。

That way only bandwidth for the audio bytes is used. If you find a better approach of doing it please let me know.

有关样本Android应用和实施检查:

For a sample Android APP and implementation check out:

<一个href=\"https://github.com/feribg/audiogetter/blob/master/audiogetter/src/main/java/com/github/feribg/audiogetter/tasks/download/VideoTask.java\" rel=\"nofollow\">https://github.com/feribg/audiogetter/blob/master/audiogetter/src/main/java/com/github/feribg/audiogetter/tasks/download/VideoTask.java

这篇关于从YouTube视频下载只有音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆