Node.JS Low Latency Rapsberry PI Camera Streaming via HTTP and VLC
Overview
Here is a short code snippet for relatively low-latency video streaming using a Raspberry Pi camera via the HTTP protocol, and viewing it in VLC. This post is inspired by a netcat approach found here.
HTTP Video Server
Code for creating an HTTP Video Server:
var spawn = require('child_process').spawn,
child = spawn('/opt/vc/bin/raspivid', ['-t', '0', '-w', '300', '-h', '300', '-hf', '-fps', '20', '-o', '-']);
var http = require("http");
var server = http.createServer(function(request, response) {
child.stdout.pipe(response);
});