共享 IP 摄像机源(RTSP?)
我有一个网络摄像机,我想分享它的动态。
它可以输出 RTSP 源以及简单的 JPEG 图像。
我正在寻找一种方法来获取单个提要并将其提供给多个观众。
实际上,在任何给定时间可能只有几个,因此我们不会一次查看 1,000 个。
我还想在没有硬件的情况下完成此操作,只有相机输出其提要。
互联网上是否有一种服务可以获取该提要并以某种方式将其提供给多人?
也许实现这一点的方法是将 RTSP 转码为浏览器更容易接受的内容,这是一个选择吗?
再说一次,我这边没有硬件,我不想在我这边放一排计算机(甚至一台)。
I have an IP camera and I would like to share its feed.
It can output an RTSP feed as well as simple JPEG images.
I am looking for a way to take that single feed and serve it to multiple viewers.
In reality there may only be a few at any given time, so were not looking at 1,000's at once.
I also want to do this with no hardware on my end, just the camera, outputting its feed.
Is there a service on the internet that can take that feed and serve it out to multiple people in some way?
Maybe the way to do it, is to transcode that RTSP to something more palatable to browsers, is that an option?
Again, no hardware on my end, I don't want racks of computers (even 1) sitting at my end of things.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
首先您需要从摄像机接收 RTSP 流。有一些开源库可以使用,比如Live555。然后需要将流转换为浏览器可以播放的协议。这可以是 HTTP 直播流 (HLS) 或基于 HTTP 的动态自适应流 (MPEG-DASH)。如果支持媒体源扩展 (MSE),则可以使用 HTML5 视频播放这些流。较旧的浏览器不支持 MSE,因此您需要一个后备播放器(例如,基于 Adobe Flash 且支持 HLS 或 MPEG-DASH 的播放器)。
有一些基于云的服务可为您的 IP 摄像机广播提供完整的解决方案。我测试了IPCamLive.com,它对我来说工作得很好。
我在 IPCamLive 中最喜欢的一点是,该服务提供了一个用于嵌入摄像头的简单 HTML 片段,因此我只将此片段粘贴到我的网页中。另一个好处是该服务支持 ONVIF 协议,可以帮助您找到摄像机流的正确 RTSP URL。
First you need is to receive the RTSP stream from the camera. There are some open source libraries that can be used like Live555. Then you need to convert the stream to a protocol that can be played by the browsers. This can be HTTP Live Streaming (HLS) or Dynamic Adaptive Streaming over HTTP (MPEG-DASH). These streams can be played by using HTML5 video if Media Source Extensions (MSE) is supported. Older browsers does not supports MSE so you need a fallback player (e.g. Adobe Flash based player with HLS or MPEG-DASH support).
There are some cloud based service that provides complete solution for broadcasting your IP camera. I tested IPCamLive.com and it's working fine for me.
The best thing that I liked in IPCamLive is that this service provides a simple HTML snippet for embedding the camera so I only pasted this snippet into my web page. Another good thing is that this service supports ONVIF protocol that can help you to find the proper RTSP URL of your camera stream.
相机型号是什么?如果支持 RTSP 和 JPEG,则只需将 JPEG 的端口 80 和 RTSP 的 554 端口从路由器转发到摄像机的本地 IP 地址。另外,您应该拥有静态 IP,或者在 dyndns.org 上注册您的动态地址并为其获取 DNS 名称。
然后,如果用户想要查看来自该摄像机的 RTSP 流,他们可以从引用的 RTSP url 打开它摄像机所在路由器的 WAN IP 地址。
对于 AXIS 摄像机和上述设置:
这将路由到
10.10.10.1:554
,即 IP 摄像机。如果相机支持 UPnP,您可以减少工作量。然后只需将其打开,您将获得用户必须在其 URL 中输入的地址以及要添加的端口。
现在,如果您想在浏览器中显示此内容,您可能希望获取 MOTION JPEG(如果支持),或者定期获取 JPEG...
Whats the camera model? If it supports RTSP and JPEG, you only need to forward ports 80 for JPEG and 554 for RTSP from the router to a local IP address of the camera. And also, you should have static IP, or register your dynamic address at dyndns.org and get a DNS name for it.
Then if users want to see RTSP stream from that camera they can open it from a RTSP url referring to the WAN IP address of the router the camera is on.
For the AXIS camera and the setup from above:
That will route to the
10.10.10.1:554
which is the IP camera.You can do the less work, if the camera supports UPnP. Then just turn it on, and you will get what address users have to put in their URL and the port to add.
Now, if you want to display this in browsers, you probably want to get the MOTION JPEG if it is supported, or get JPEG periodically...
使用媒体服务器...
媒体服务器聚合连接,因此设备不必面向前。
有一些...
我的是@ http://net7mma.codeplex.com/
有一个codeproject我的图书馆的文章@ http://www.codeproject.com/Articles/507218/Managed-Media-Aggregation-using-Rtsp-and-Rtp
它支持非 rtp 源,例如 HTTP Jpeg 和 MJpeg您指定的变体,此外它还支持从 jpeg 图片动态创建 RTP MJPEG。
您还可以选择使用重新启动间隔并仅发送已更改的最小编码单元 (MCU),从而减少发送的数据量并获得或多或少接近 MPEG 的带宽。
它可以与 VLC、QuickTime、(S)MPlayer 和各种其他播放器配合使用。
它的主要目的是按照您的要求进行聚合,并且还支持录制为 rtpdump 格式。
它可以在 Mono 或 .Net 中运行,目前的目标是 4.5.2,因为还计划提供一些编码和解码支持。
Use a Media Server...
The media server aggregates the connection so the device does not have to be forward facing.
There are a few...
Mine is @ http://net7mma.codeplex.com/
There is a codeproject article for my library @ http://www.codeproject.com/Articles/507218/Managed-Media-Aggregation-using-Rtsp-and-Rtp
It supports non - rtp sources such as the HTTP Jpeg and MJpeg variations you specify, in addition it also supports creating RTP MJPEG from jpeg pictures on the fly.
You also have the option of using Restart Intervals and sending only the Minimum Coded Units (MCUs) which have changed and thus you will decrease the amount of data sent and get bandwidth which is more or less closer to MPEG.
It works with VLC, QuickTime, (S)MPlayer and various other players.
It's main purpose is aggregation like you require and it also supports recording to rtpdump format.
It works in Mono or .Net and currently targets 4.5.2 because some encoding and decoding support is planned also.