问题
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?
回答1:
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.
回答2:
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 <<-
来源:https://stackoverflow.com/questions/8289421/process-rtsp-with-node-js-for-taking-an-image-snapshot