admin管理员组

文章数量:1530845

2024年6月28日发(作者:)

网络摄像机

+VLC+Nod +HTML5

网络摄像机大部分都需要安装插件才能看, 对于我们这些搞

B/S

的来说比较麻烦, 最近项 目中

要用到摄像机实时监控, 所以查询了些资料。 公司采用的大华的东西, 将设备全部接入 一个局域

网中,设置好

ip

摄像机

1 (192.168.8.110)

摄像机

2 (192.168.8.180)

硬盘录像机

NVR (192.168.8.108)

百度了一下大华(包含

NVR/

摄像机)

RTSP

地址:

rtsp://user:pwd@ip:port/cam/ realmonitor?channel=1&subtype=0

channel

通道,

NVR

分通道。

subtype

码流,

0

代表主码流(高清

1080P

),

1

代表辅码流

(704*576(D1)).

直接访问摄像机:

摄像机

1:rtsp://admin:admin@192.168.8.110:554

摄像机

2:rtsp://admin:admin@192.168.8.110:554

访问

NVR:

摄像机

1:rtsp://admin:admin@192.168.8.108:554

摄像机

2:rtsp://admin:admin@192.168.8.108:554

/cam/realmonitor?channel=1&subtype=0

/cam/realmonitor?channel=1&subtype=0

/cam/realmonitor?channel=1&subtype=0

/cam/realmonitor?channel=2&subtype=0

Html5 <video>

并不支持

rtsp,

所以使用

vlc

进行转码 將

rtsp

http

这样

<video>

就可以直接

播放。

使用

vlc

命令,在

cmd

命令下使用(注意下面是一行命令)

vlc -I dummy -vvv

"rtsp://admin:admin@192.168.8.110:554 /cam/realmonitor?channel=1&subtype=1"

--sout="#transcode{vcodec=theo,vb=800,acodec=vorb,ab=128,channels=2,samplerate=44100}:ht

tp{mux=ogg,dst=:8080/cam}" --sout-all --sout-keep

多行

0%-100%

,基本上就是成功了

vk 4dummy -w

r

"rBp://adrriin:ddmin@192d6S8J1C;554/cam/realnio..

t

-

[S2 Oaf Im?[: J care Input debug Buffering 62Z

[020a£J)i9c ] care input debug Buffering

62a

[020af1 core inmit dehug Riiffering

[BQ b9& : debu^ Buff citing GS>£

[G20afb9c] core Imuut debug Bufftirlny 68<

LldMBaf bVE J care input debug UuliBring b8X

[020afJ)i9c] care input debug Buffering 73>c

[|Q2 BajFb9c ] cai*e input debug Buffering

73

K

[B2

B

CL

T

b9i^ ] cure -Luput debug Duff

E

ring-

73

K

LKGiHaf JtuVc J care Input debug Buffering

8瞅

[020a£hi9c] care input debug Buffering 8

f G2BaFb9c ]

HCIHE

input debug BufFevlng iRz

[BQ BaJb?Q ] sar-c xnp4.1t: debu^ DufTc ring 8S>£

[£l2 0af In?c ] care Input debug Buffering 8B^

[Q28afb9c1 core input debug Buffering 8Bz

02

旦刊

Fh9

匸]

core input debug Bufferina

怕乂

[Q2OaJFb?c ]

COME

input debug DuffDvlng

93

M

[62Bctfb9c ] core liiiputr debug Buffering

93

K

Lld2Ua£J]ii9[: J care input debug Stream Ibuffering done ClUltl

ms

±n lUld ms>

[020a£b?c 1 care inwt debug Decodet* uait done tn 6

ms

[621 &ai*e

IHILM

late fcudf£er for mux input

[B2 BcSaBc ] icaifc mux war-nJLng late hu-Ffer fci- nnux input <173667^

LM2Hy571c ] stFeaji_ou.t_transcodB stream out warningr: Reseting video

ye

A

W

HTML5

con trols="c on trols" loop="loop">

width="600"

height="450" autoplay="autoplay"

Your browser does not support the video tag.

chrome

打开页面就可以看到了

<-■ C □ 127.0.0J/agro/cam/

+HTML5

采用

启动

vic

,这里是多个摄像头

var child_process = require('child_process');

function ope nCam(rtsp,path){

var server=child_ n("C:Program Files

(x86)",["-l","dummy","-vvv",rtsp,"--sout=#tra nscode{vcodec=theo,vb=8

00,acodec=vorb,ab=128,cha nn els=2,samplerate=44100}:http{mux=ogg,dst="+path+"}","--sout-all

",”--sout-keep"]);

//dummy

可以修改为

--no-dummy-quiet

,隐藏

vlc

命令窗口

server.o n('exit', function (code, sig nal) {

con sole .lo g('service exit');

});

}

openCam('rtsp://admin:admin@192.168.8.108:554 /cam/realmonitor?channel=1 &subtype=1',':8

800/cam');//

摄像机

110

openCam('rtsp://admin:admin@192.168.8.108:554 /cam/realmonitor?channel=2&subtype=1',':8

801/cam');//

摄像机

180

目前只能一个摄像机一个端口,端口复用暂时不知道怎么弄。

HTML

con trols="c on trols" loop="loop">

width="600" height="450" autoplay="autoplay"

Your browser does not support the video tag.

trols="c on trols" loop="loop">

Your browser does not support the video tag.

运行

node app

,打开

html

即可

____________________________________________________________________________________________________________________________________________________________________________

• cr

□ 9 27 A£L l/dgro/cafri/

经过测试

PC chrome

、安卓

UC

都能打开。

本文标签: 摄像机网络端口代表监控