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

发布于 2024-12-18 10:12:54 字数 480 浏览 0 评论 0原文

我有一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

屋檐 2024-12-25 10:12:54

我几个月前确实找到了答案,但忘记了我在这里问过。

我的代码位于 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.

又爬满兰若 2024-12-25 10:12:54

下面是一些具有最小依赖性的代码,可以从网络摄像头读取数据并使用 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 <<-

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文