I am trying to stream video from my ar drone but it is not working. I have installed ffmpeg version 2.6, am using Ubuntu 14.04, node.js and the ar-drone npm module. I am also using version 1.0 of the ar drone. I was told that I need to use 2.0 because that is what the modules were built using but I would rather not purchase a new one if I don't have to.Below is the code that I am using
var arDrone = require('ar-drone');
var http = require('http');
console.log('Connecting png stream ...');
var pngStream = arDrone.createClient().getPngStream();
var lastPng;
pngStream
.on('error', console.log)
.on('data', function(pngBuffer) {
lastPng = pngBuffer;
});
var server = http.createServer(function(req, res) {
if (!lastPng) {
res.writeHead(503);
res.end('Did not receive any png data yet.');
return;
}
res.writeHead(200, {'Content-Type': 'image/png'});
res.end(lastPng);
});
server.listen(8080, function() {
console.log('Serving latest png on port 8080 ...');
});
When I run it and go to http://localhost:8080/ in my browser I get the error message "Did not receive any png data yet." Is this because I am using version 1.0 of the drone??