# Question: How can we stream video to SpectralWorkbench.org or Infragram.org from a Raspberry Pi camera?

warren asked on December 05, 2017 17:43
313 | 1 answers | #15301

This is a key part of ease of use with Raspberry Pi based spectrometers, and also Infragram use with Raspberry Pi cameras:

Would love to modify both these pieces of software to be able to stream from a Rasberry Pi on a local network, or even on the same device. The relevant code sections are:

There's some really good starting code here: https://www.sitepoint.com/streaming-a-raspberry-pi-camera-into-vr-with-javascript/

Looks like you can just load it as an image using this code, and insert it:

      var piImage = new Image();

context.drawImage(piImage, 0, 0, canvas.width, canvas.height);
}

piImage.src = "http://raspberry.local/cam_pic.php?time=" + new Date().getTime();


But we'll need to set up CORS permissions on the Pi to do this from SpectralWorkbench.org or Infragram.org, unless we run a version of that code on the Pi itself: https://enable-cors.org

Is this a question? Click here to post it to the Questions page.