使用 PHP 将网络摄像机流嵌入网站?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4657554/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Embed IP Camera streaming into website with PHP?
提问by benhowdle89
I have done a quick google on this but i was wondering if this is possible? I have opened up ports on our router to it so its accessible from anywhere but could i use PHP or similar to grab live streaming and show it on a website somewhere?
我已经对此进行了快速谷歌搜索,但我想知道这是否可能?我已经在我们的路由器上打开了端口,以便它可以从任何地方访问,但我可以使用 PHP 或类似的工具来获取实时流媒体并将其显示在某个网站上吗?
采纳答案by rik
Try this (HTML5) or just the inner object (HTML<5) with all occurences of %StreamURL%
replaced with the URL of your stream.
试试这个 (HTML5) 或只是内部对象 (HTML<5),所有出现的都%StreamURL%
替换为您的流的 URL。
<video width="320" height="240" autoplay controls>
<source src="%StreamURL%" type="video/mp4">
<object width="320" height="240" type="application/x-shockwave-flash" data="http://releases.flowplayer.org/swf/flowplayer-3.2.5.swf">
<param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.5.swf" />
<param name="flashvars" value='config={"clip": {"url": "%StreamURL%", "autoPlay":true, "autoBuffering":true}}' />
<p><a href="%StreamURL%">view with external app</a></p>
</object>
</video>
回答by Adorjan Princz
You need a server to broadcast the stream for the viewers and player component that can work on desktop and mobile as well.
您需要一个服务器来为浏览器和播放器组件广播流,这些流也可以在桌面和移动设备上运行。
I have posted some info about this here on another stackowerflow topic: How can I display an RTSP video stream in a web page?
我已经在另一个 stackowerflow 主题上发布了一些关于此的信息: 如何在网页中显示 RTSP 视频流?
More info: http://ipcamlive.com/howdoesitwork
回答by TheUberOverLord
Please also see this to do this securely which includes live demonstrations of doing this and is free:
另请参阅此以安全地执行此操作,其中包括执行此操作的现场演示并且是免费的:
http://foscam.us/forum/showing-secure-methods-using-php-to-display-your-ip-cameras-t8721.html#p42139
http://foscam.us/forum/showing-secure-methods-using-php-to-display-your-ip-cameras-t8721.html#p42139
Don
大学教师