将RTSP流式传输到HTML网站 [英] stream RTSP to HTML website
问题描述
我想将RTSP中的IP摄像机显示到网页中。
I would like to display IP cameras streaming in RTSP into a web page.
我尝试了很多解决方案,比如使用VLC对流进行转码,但没有它们似乎足够可靠,可以创建真正的Web服务。
我正在考虑使用像flussonic或Red5这样的媒体服务器。但是我不知道它是否会起作用。
I've tried many solutions, like using VLC to transcode the stream, but none of them seems to be reliable enough to create a real web service. I'm thinking on using some media server like flussonic or Red5. But I don't know if it will work.
这就是为什么我想知道什么是最好(和简单)的解决方案来显示RTSP流网页。
This is why I would like to know what is the best (and the simple) solution to display RTSP streams on a webpage.
推荐答案
尝试了插件方式后建议
https://www.npmjs.com/package/html5_rtsp_player
我终于找到了一个使用这个插件的非常直接的解决方案,仅适用于我的项目适用于Chrome。
I finally found a really straight forward solution using this plugin, works for Chrome only which is ok for my project.
https://www.videoexpertsgroup.com/vxg-chrome-plugin/
这是html c的方法ode看起来像
This is how the html code look like
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<script type="text/javascript" src="/assets/vxgplayer-1.8.31/vxgplayer-1.8.31.min.js"></script>
<link href="/assets/vxgplayer-1.8.31/vxgplayer-1.8.31.min.css" rel="stylesheet" />
</head>
<body>
<div class="vxgplayer"
id="vxg_media_player1"
width="640"
height="480"
url="rtsp://admin:admin@192.168.1.117/defaultPrimary0?streamtype=u"
nmf-src="/assets/vxgplayer-1.8.31/pnacl/Release/media_player.nmf"
nmf-path="media_player.nmf"
useragent-prefix="MMP/3.0"
latency="10000"
autohide="2"
volume="0.7"
avsync
autostart
controls
mute
aspect-ratio
aspect-ratio-mode="1"
auto-reconnect
connection-timeout="5000"
connection-udp="0"
custom-digital-zoom></div>
</body>
</html>
这篇关于将RTSP流式传输到HTML网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!