1

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??

kingpin
  • 85
  • 1
  • 14
  • I don't think node-ar-drone is well-tested with drone version 1.0. Does everything besides the PNG stream work? – John Wiseman Apr 24 '15 at 05:38
  • It looks like maybe version 1 of the AR.Drone used UDP for the video stream, while version 2 uses TCP. It's a long shot, but maybe you could try to convert the node-ar-drone code to use UDP. – John Wiseman Apr 24 '15 at 17:26

1 Answers1

0

AR.Drone 1.0 handles video differently from the 2.0 version of AR.Drone. According to the AR.Drone Developer's Guide,

  • 1.0 uses a custom Parrot format called "P264"; 2.0 uses standard H264 (section 7.2 of the Guide).
  • 1.0 streams video over UDP; 2.0 streams over TCP (section 2.10 of the Guide).

You will not be able to use the node-ar-drone library to access the video stream without a significant amount of work:

But really, almost certainly the best option is to simply buy an AR.Drone 2.0 (available new for around $300 as of April 2015) and use the existing code that is supported and used by other people.

Community
  • 1
  • 1
John Wiseman
  • 3,081
  • 1
  • 22
  • 31