Faster Real Time A.R Drone Video Streaming

寵の児 提交于 2019-12-11 05:36:16

问题


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?

来源:https://stackoverflow.com/questions/46062700/faster-real-time-a-r-drone-video-streaming

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!