Node.js - MJPEG TCP stream to base64 images
问题 Based on paparazzo.js lib, I'm trying to get base64 images from a MJPEG stream (streamed over TCP with GStreamer) in a Node.js server, and to send them to the clients via websockets. I think I'm pretty close, but my images are corrupted. Here is the code I'm using : var boundary = "----videoboundary"; var data = ""; var tcpServer = net.createServer(function (socket) { socket.on('data', function(chunk) { var boundaryIndex = chunk.toString().indexOf(boundary); if (boundaryIndex !== -1) { // Get