[java]如何在web浏览器上实时监控摄像头?
天蓬老师
天蓬老师 2017-04-18 10:56:03
0
3
1782

摄像头是海康威视的,不用海康威视自带的后台系统监控系统,想自己写一个网页显示。
本来以为很简单的事,但发现还是有难度的,后台获取摄像头的数据流大概是ByteByReference类型。
海康威视里面的开发实例是个jFrame的实例,线索追踪到

   if (!playControl.PlayM4_InputData(m_lPort.getValue(), pBuffer, dwBufSize))  //输入流数据
    {
        break;
    }

之后就想消失掉了一样,只在PlayCtrl这里定义了一句:

    boolean PlayM4_InputData(NativeLong nPort, ByteByReference pBuf, int nSize);

搜索全部java文件都没有这个接口的实现,可能是隐藏在了那些(我看不懂的)库文件里了。而且pBuffer这个应该指的就是数据流吧,但它在哪里赋值的也不清楚.

*******(以上都是废话)*******
我的设想是:用socket长链接传送ByteByReference数据给浏览器。
但是现在有个问题:浏览器要怎么接收和解释这类型的数据啊??:( 向各位大侠请教一下。Thanks.
还有一个问题是PlayM4_InputData里面处理过些什么也不知道,所以pBuffer是不是在输出之前改过也不清楚。


[用插件的方法]要下载一个VLC软件,还得只能在IE浏览器上运行。

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Streamedian player example</title>
</head>
<body>

<object type='application/x-vlc-plugin' pluginspage="http://www.videolan.org/" id='vlc' events='false' width="720" height="410">
    <param name='mrl' value='rtsp://admin:hx123456@113.106.249.238:554/Streaming/Channels/101?transportmode=unicast' />
    <param name='volume' value='50' />
    <param name='autoplay' value='true' />
    <param name='loop' value='false' />
    <param name='fullscreen' value='false' />
    <param name='controls' value='false' />
</object>

</body>
</html>
天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(3)
迷茫

It is recommended to use video publishing software to publish the camera into a RTMP video stream. Then play this video stream on the client

左手右手慢动作

Hello poster, you mean to download vlc, use the following code, and change the parameters rtsp://admin:hx123456@113.106.249.238:554/Streaming/Channels/101?transportmode=unicast' to your own. Can I obtain Hikvision’s surveillance footage?

伊谢尔伦

The simplest way is to connect to EZVIZ Cloud and set up the live broadcast. The URL of M3U8 will be provided. It can be played directly in modern browsers (including mobile phones) without any plug-ins. Some operations can directly call the HTTP API provided by EZVIZ Cloud. , the disadvantage is that you need to purchase EZVIZ Cloud traffic (very cheap, small quantity seems to be free)

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!