RTMP:有这样的linux命令行工具吗?
我到处寻找一个可以让我下载 rtmp 流的 Linux 实用程序。 不是 flv 视频而是 MP3 流。 我想要下载的流的位置就是这种格式。
rtmp://live.site.com/loc/45/std_fc74a6b7f79c70a5f60.mp3
有人知道这样的命令行工具吗? 或者甚至任何接近我要求的东西?
我不需要完整的软件应用程序,如果它可以通过 Shell 或其他方式在 Linux 上运行,那就太好了。
谢谢大家
I have looked everywhere to find a linux utility that will allow me to download rtmp streams. Not flv video but MP3 streams. The location of the streams I want to download are in this format.
rtmp://live.site.com/loc/45/std_fc74a6b7f79c70a5f60.mp3
Anyone know of such a command line tool? Or even anything close to what I am asking for?
I do not want full software applications and it would be great if it worked on Linux via Shell or something.
Thanks all
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您有使用 RTMP 访问权限编译的
mplayer
或vlc
,则应执行以下操作之一。这将生成一个
./stream.dump
。这将生成一个
./output.mpg
。 您必须对其进行解复用才能仅提取音频流。One of the following should do, if you have
mplayer
orvlc
compiled with RTMP access.This will generate a
./stream.dump
.This will generate a
./output.mpg
. You'll have to demux it to extract just the audio stream out.这个问题很旧,但这可以帮助有此疑问的其他用户。
要直接下载而不进行任何转换,有两种选择(两个程序的作者相同,行为相同):
rtmpdump -r "rtmp://host.com/dir/file.flv" -o filename.flv
flvstreamer -r "rtmp://od.flash.plus.es/ondemand/14314/plus/plustv/PO770632.flv" -o salida.flv
如果您想下载并转换同时播放视频,最好的方法是使用ffmpeg:
This question is old but this can help to another users with this doubt.
To download directly, without any conversion, there is two options (the author of both programs is the same and the behavior is the same):
rtmpdump -r "rtmp://host.com/dir/file.flv" -o filename.flv
flvstreamer -r "rtmp://od.flash.plus.es/ondemand/14314/plus/plustv/PO770632.flv" -o salida.flv
And if you want download and convert the video at same time, the best way is use ffmpeg:
我认为自之前的一些答案以来,情况已经发生了一些变化。 至少根据 rtmp 维基百科页面。 看来 rtmp 协议规范已开放供公众使用。 为此,您可以使用 2 个工具来完成原始发布者的要求:
rtmpdump
和ffmpeg
。 以下是我下载发送音频播客的 rtmp 流的方法。步骤#1 - 下载流
我使用工具rtmpdump来完成此操作。 就像这样:
步骤 #2 - 将 flv 文件转换为 mp3
好的,现在您已经获得了流的本地副本,file.flv。 您可以使用 ffmpeg 进一步询问文件并仅提取音频部分。
从上面的输出中,我们可以看到 file.flv 包含单个流,只是音频,它是 mp3 格式,并且是单个通道。 要将其提取到正确的 mp3 文件,您可以再次使用
ffmpeg
:上述命令会将音频流复制到文件 file.mp3 。 您也可以将其提取到 wav 文件,如下所示:
此页面对于确定如何将 flv 文件转换为其他文件很有用格式。
I think the landscape has changed a bit since the time of some of the previous answers. At least according to the rtmp wikipedia page. It would appear that the rtmp protocol specification is open for public use. To that end you can use 2 tools to accomplish what the original poster was asking,
rtmpdump
andffmpeg
. Here's what I did to download a rtmp stream that was sending an audio podcast.step #1 - download the stream
I used the tool rtmpdump to accomplish this. Like so:
step #2 - convert the flv file to mp3
OK, so now you've got a local copy of the stream, file.flv. You can use
ffmpeg
to interrogate the file further and also to extract just the audio portion.From the above output we can see that the file.flv contains a single stream, just audio, and it's in mp3 format, and it's a single channel. To extract it to a proper mp3 file you can use
ffmpeg
again:The above command will copy the audio stream into a file, file.mp3. You could also have extracted it to a wav file like so:
This page was useful in determining how to convert the flv file to other formats.