title: Streaming webcam data in Node.js
body: <p>I have a Raspberry Pi (2B, running Raspbian Jessie 02/09), and a webcam (ID 041e:406c Creative Technology, Ltd Live! Cam Sync [VF0520], V4L compatible).</p>
  
  <p>I'm trying to build a robot, and how I imagined the camera would work was like this:</p>
  
  <p>Pi (Node.js) -> Server (Computer, Node.js, running Electron to create windows for the camera image).</p>
  
  <p>The goal was to send the data from the Pi to the server using sockets (socket.io) at an useable framerate (10~20?).</p>
  
  <p>I've looked into modules such as:</p>
  
  <ul>
  <li>node-camera, which did not work (blank image), and used websockets.</li>
  <li>node-opencv (opencv on npm), which failed to compile, and when it did, did not properly detect the camera (however python detected it perfectly with opencv)</li>
  </ul>
  
  <p>A lot of the guides I've found on the internet required the client to be connected to a browser, to be able to retrieve the webcam data, which isn't what I wanted.</p>
  
  <p>Any help would be appreciated, thanks!</p>
  
  <p><strong>Edit:</strong>
  To clarify, I have a Node.js socket.io server which I want jpeg (or other formats) webcam data to be passed to at a reasonable framerate from a Node.js (v5.6.0) client.</p>