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.
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);
});