HTML5的标签能够用使用下来面的方式来播放静态视频node
<video width="320" height="240" controls="controls"> <source src="movie.ogg" type="video/ogg"> <source src="movie.mp4" type="video/mp4"> Your browser does not support the video tag. </video>
但目前桌面版本的chrome,firefox,ie却没法播放实时视频流。但在移动端可使用HLS来播放实时视频。git
除了Video能够播放视频外还可使用canvas来播放视频。原理是使用websocket来取视频,而后解码成图片,渲染到canvas上。github
在npm上可使用node-rstp-stream来转码RTSP视频流web
github地址:https://github.com/phoboslab/jsmpegchrome