简体   繁体   English

使用Node.js处理RTSP以拍摄图像快照

[英]Process RTSP with Node.js for taking an image snapshot

I have a RTSP that I would love to make Node.JS understand. 我有一个RTSP,我很想让Node.JS理解。 I found a way to do it using Java taking a capture from a webcam but I would love to just use Node.js on this task and get it from a video RTSP'd. 我找到了一种方法, 使用Java从网络摄像头捕获,但我很乐意在此任务上使用Node.js并从视频RTSP中获取它。

My intention is to use setInterval, grab the stream, convert it to base64 and stream it through Socket.IO to a client so they can see it as a <img> tag on their browser. 我的目的是使用setInterval,获取流,将其转换为base64并通过Socket.IO将其流式传输到客户端,以便他们可以在浏览器中将其视为<img>标记。 Much of this will be taken from the guy who make it with a webcam but I only have a RTSP available as video-source. 其中大部分将来自使用网络摄像头制作它的人,但我只有一个RTSP可用作视频源。

So, does anyone knows if there's a way to do this? 那么,有没有人知道是否有办法做到这一点?

I really found the answer months ago but forgot I asked here. 几个月前我真的找到了答案,但忘了我在这里问。

My code is at https://github.com/ghostbar/RTSP-Streaming.js . 我的代码位于https://github.com/ghostbar/RTSP-Streaming.js It reads it from an RTSP stream and converts it to JPEG, then to base64 in order to pass it via Socket.IO to the client. 它从RTSP流中读取它并将其转换为JPEG,然后转换为base64,以便通过Socket.IO将其传递给客户端。

Here's some code with minimal dependencies which can read data from a Webcam and upload it to as an image on the server using Node: https://github.com/josher19/node-jpegcam 这里有一些具有最小依赖关系的代码,可以从网络摄像头读取数据并使用Node将其作为服务器上的图像上传: https//github.com/josher19/node-jpegcam

You could have it send the data to the client instead of saving it as an image on the server. 您可以让它将数据发送到客户端,而不是将其保存为服务器上的图像。

->> Josh <<- - >> Josh << -

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM