分离音频和视频流

发布于 2024-10-02 09:00:03 字数 291 浏览 4 评论 0原文

虽然我不确定 Stack Overflow 是否是问这个问题的最佳地点,但它是我能想到的最好的地方,看看我的谷歌技能如何让我失望......尽管这个问题并不特定于我认为的任何语言这里的人们应该能够帮助我了解概念和理论。

所以,话虽如此……

我见过很多从 YouTube 视频中提取音频的服务。因为我很好奇用视频编程,所以我认为实现同样的事情将是一种相当有益且简单的介绍方法。

至于该主题的技术细节,我迷失了。我对视频播放的工作原理不太清楚,而且我也不知道如何通过编程来分离这些东西。

感谢您的时间和耐心。

While I'm not sure whether Stack Overflow is the best place to ask this question, its the best I could come up with see how my google skills are failing me... Even though this question isn't specific to any language I think that people here should be able to help fill me in on the concepts and theory.

So, with that said...

I've seen quite a few services that rip the audio from say a youtube video. Seeing as I am curious to program with video and what not I thought achieving the same thing would be a rather beneficial and easy way to be introduced.

As for technical details on the subject I am lost. I don't have a good idea on the nitty gritty of how video play back works, and I am clueless to how one would separate those things through programming.

Thanks for the time and patience.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

满栀 2024-10-09 09:00:03

您可以通过以下方式使用 VLC 应用程序执行此操作:

just audio

vlc --daemon --ttl 7 --ipv4 "/home/user/song.mp3" :sout='#transcode{acodec=mp3,ab-128 }:std{access=mmsh,mux=asfh,dst=:3333}' :no-sout-rtp-sap :no-sout-standard-sap :sout-

只保留视频

vlc --daemon --ttl 7 -- ipv4 v4l2:///dev/video0 :v4l2-standard=0 :input-slave=alsa:// :sout='#transcode{vcodec=div3,vb=2000,scale=1,acodec=none}:std{ access=mmsh,mux=asfh,dst=:3333}' :no-sout-rtp-sap :no-sout-standard-sap :sout-keep

You can do this with the VLC application in the following way:

just audio

vlc --daemon --ttl 7 --ipv4 "/home/user/song.mp3" :sout='#transcode{acodec=mp3,ab-128}:std{access=mmsh,mux=asfh,dst=:3333}' :no-sout-rtp-sap :no-sout-standard-sap :sout-keep

just video

vlc --daemon --ttl 7 --ipv4 v4l2:///dev/video0 :v4l2-standard=0 :input-slave=alsa:// :sout='#transcode{vcodec=div3,vb=2000,scale=1,acodec=none}:std{access=mmsh,mux=asfh,dst=:3333}' :no-sout-rtp-sap :no-sout-standard-sap :sout-keep

冷默言语 2024-10-09 09:00:03

你可以看看TAE, http://github.com/tuna74/TunaAudioExtracter 。请记住,TAE 仅转储音频流,并且仅在必要时进行转码。

You can take a look at TAE, http://github.com/tuna74/TunaAudioExtracter . Please keep in mind that TAE only dumps the audio stream and only does transcoding if necessary.

谎言月老 2024-10-09 09:00:03

这是一个相当广泛的问题,但我会尝试一下。基本上有两种方法:

  1. 模拟播放,并以某种方式捕获输出音频。
  2. 下载或窃听以从服务器获取原始视频流并将其保存到磁盘。然后,了解容器格式的布局,提取仅编码音频的比特流。

即使您无法对格式进行逆向工程,也可以实现选项 1,但我认为它不是一个流行的选择,因为它很慢,并且需要再次对音频进行编码,从而可能导致质量下降。所以方案2是首选。

我不知道有关 Adob​​e FLV 流(YouTube 使用的)的详细信息,只知道 FLV 是一种将音频/视频信号组合在单个流中的容器格式。您将必须学习如何解析它们(或找到一个可以为您完成此操作的库)。您还需要找到要读取的 flv 流的 url。为了进行测试,您可以在播放视频后从临时 Internet 文件中读取它。

This is quite a broad question but I'll give it a try. There are basically two approaches:

  1. Simulate playback, and capture the output audio somehow.
  2. Download or eavesdrop to get the raw video stream from the server and save it to disk. Then, knowing the layout of the container format, extract the bitstream that encodes just the audio.

Option 1 can be implemented even if you can't reverse engineer the format, but I don't think it is a popular choice as it is slow, and requires encoding the audio once more, causing a possible drop in quality. So Option 2 is preferred.

I don't know the details about Adobe FLV streams (which is what YouTube uses), except that FLV is a container format that combines audio/video signals in a single stream. You will have to learn how to parse them (or find a library that will do it for you). You will also need to find the url for the flv stream you want to read. For testing, you can start with reading it from your temporary internet files after you played back the video.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文