使用 Node.js 处理 RTSP 以拍摄图像快照
我有一个 RTSP,我想让 Node.JS 理解它。我找到了一种方法使用 Java 从网络摄像头捕获< /a> 但我很乐意在这个任务中使用 Node.js 并从视频 RTSP 中获取它。
我的目的是使用 setInterval,抓取流,将其转换为 base64 并通过 Socket.IO 将其流式传输到客户端,以便他们可以在浏览器上将其视为
标记。其中大部分内容将取自使用网络摄像头制作的人< /a> 但我只有一个 RTSP 可用作视频源。
那么,有谁知道是否有办法做到这一点?
I have a RTSP that I would love to make Node.JS understand. 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.
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. 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.
So, does anyone knows if there's a way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我几个月前确实找到了答案,但忘记了我在这里问过。
我的代码位于 https://github.com/ghostbar/RTSP-Streaming.js 。它从 RTSP 流中读取数据并将其转换为 JPEG,然后转换为 base64,以便通过 Socket.IO 将其传递到客户端。
I really found the answer months ago but forgot I asked here.
My code is at 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.
下面是一些具有最小依赖性的代码,可以从网络摄像头读取数据并使用 Node 将其作为图像上传到服务器上: https://github.com/josher19/node-jpegcam
您可以让它将数据发送到客户端,而不是将其保存为服务器上的图像。
->>乔什<<-
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
You could have it send the data to the client instead of saving it as an image on the server.
->> Josh <<-