A.R Drone 2.0 Video Streaming Latency

360 views Asked by At

I am working on video streaming with the AR Drone 2.0 using different codes I have found on the internet. I've attempted ffplay tcp://192.168.1.1:5555 to video stream from the AR Drone 2.0; however, the delay is way too high.

My second attempt was with the following:

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

This only streamed images. I had to refresh browser every second.

My third option was using this option:

var arDrone=require('ar-drone')
var client= arDrone.createclient();
require('ar-drone-png-stream')(client,{port:8000})

It streamed a lot of images in a short amount of time. The delay is still significant and I'm looking for a video.

Are there other approaches that will significantly lower the delay of the video stream?

2

There are 2 answers

3
bukkojot On

How much delay? Which other options you have to feed videos?

Try to minimize buffers impact:

ffplay -vf setpts=PTS/2 tcp://192.168.1.1:5555
0
Christian Taddey On

fwiw now, I had the same problem with a newer Tello drone. The trick is to force a higher framerate of than the drone will provide. Otherwise the extra frames will get buffered and you will have a ever-increasing delay. so add -framerate 35 at the end and there you go! (or higher values)