简体   繁体   English

将 rtsp ip 摄像头流式传输到网站

[英]Stream rtsp ip camera to website

My question is related to streaming of an ip cam with rtsp on my website.我的问题与在我的网站上使用 rtsp 流式传输 ip cam 有关。 The rtsp link I have is something like this (for obvious reasons I can't share the real one) rtsp://test.ddns.net:4000/profile2.我拥有的 rtsp 链接是这样的(出于显而易见的原因,我无法分享真实的链接)rtsp://test.ddns.net:4000/profile2。

I tried to display it on my website using embedded code but I can't find one, or didn't work on some browsers or didn't work at all.我尝试使用嵌入式代码在我的网站上显示它,但我找不到,或者在某些浏览器上不起作用或根本不起作用。 So I'm asking if someone had same problem here and how to make it work on all browsers, possibly without using plugins for browsers.所以我问是否有人在这里遇到同样的问题,以及如何使其在所有浏览器上都能正常工作,可能不使用浏览器插件。

Ps i read a lot of forums these days and if possible I want to achieve that without using wowza or other services. Ps 这些天我阅读了很多论坛,如果可能的话,我想在不使用 wowza 或其他服务的情况下实现这一目标。

Some examples of code I used:我使用的一些代码示例:

<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
        codebase="http://www.apple.com/qtactivex/qtplugin.cab"
        width="640" height="496">
        <param name="src" value="sample-movie.qtl" />
        <param name="autoplay" value="true" />
        <param name="pluginspage" value="http://www.apple.com/quicktime/download/" />
        <param name="controller" value="true" />
        <!--[if !IE]> <-->
        <object data="sample-movie.qtl" width="640" height="496" type="video/quicktime">
            <param name="pluginurl" value="http://www.apple.com/quicktime/download/" />
            <param name="controller" value="true" />
        </object>
        <!--> <![endif]-->
    </object>

with sample-movie.qtl:使用样本电影.qtl:

<?xml version="1.0"?>
<?quicktime type="application/x-quicktime-media-link"?>
<embed
autoplay="true"
fullscreen="full"
href="http://www.apple.com/quicktime/"
src="rtsp://test.ddns.net:4000/profile2"
/>

And I also tried VLC code:而且我还尝试了 VLC 代码:

<OBJECT classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921"
 codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab"
 width="640" height="480" id="vlc" events="True">
<param name="Src" value="rtsp://cameraipaddress" />
<param name="ShowDisplay" value="True" />
<param name="AutoLoop" value="False" />
<param name="AutoPlay" value="True" />
<embed id="vlcEmb"  type="application/x-google-vlc-plugin" version="VideoLAN.VLCPlugin.2" autoplay="yes" loop="no" width="640" height="480"
 target="rtsp://cameraipaddress" ></embed>
</OBJECT>

But still no solution fits all browsers, vlc code doesn't even show the image of the cam.但是仍然没有适合所有浏览器的解决方案,vlc 代码甚至不显示凸轮的图像。 For now the ony solution that partially works is the quicktime one, but only on firefox for window and IE.目前,部分有效的解决方案是 quicktime 解决方案,但仅适用于 windows 和 IE 的 Firefox。

Sorry for the long post, but I hope someone can help me understand better the streaming and rtsp protocol and hopefully help me find a solution.抱歉这篇长文章,但我希望有人能帮助我更好地理解流媒体和 rtsp 协议,并希望能帮助我找到解决方案。

Regards, Aleksander问候, 亚历山大

2020 update - you have two main options, depending on required latency: 2020 年更新 - 您有两个主要选项,具体取决于所需的延迟:

  1. latency of 10-30 seconds. 10-30 秒的延迟。 Use some application that receives RTSP stream and converts it to HLS.使用一些接收 RTSP 流并将其转换为 HLS 的应用程序。 ffmpeg is an obvious free choice; ffmpeg 是一个明显的自由选择; most free and commercial media servers will do it too.大多数免费和商业媒体服务器也会这样做。

  2. Near-real-time: latency below 1 second: use WebRTC and you have two ways to go:近实时:延迟低于 1 秒:使用 WebRTC,您有两种方法:

    • Install on-premise media server software that will convert RTSP to WebRTC: there are free and commercial options;安装将 RTSP 转换为 WebRTC 的本地媒体服务器软件:有免费和商业选项; try Ant Media Server, Unreal Media Server, Kurento.试试 Ant 媒体服务器、虚幻媒体服务器、Kurento。
    • Use WebRTC clouds like Millicast or Phenix.使用 WebRTC 云,如 Millicast 或 Phenix。

You will need to convert server side to something more browsers support, like MSE.您需要将服务器端转换为更多浏览器支持的内容,例如 MSE。 using wowza or red5 to do the conversion is probably the easiest route.使用 wowza 或 red5 进行转换可能是最简单的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM