我正在尝试从我的ar无人机上播放视频,但它不起作用。我已经安装了ffmpeg版本2.6,am使用Ubuntu14.04,node.js和ar无人机npm模块.我也在使用1.0版的ar无人机。我被告知我需要使用2.0,因为这是使用的模块,但我宁愿不购买一个新的,如果我没有to.Below是我正在使用的代码
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 ...');
});当我运行它并在浏览器中转到http://localhost:8080/时,我会得到错误消息“还没有收到任何png数据”。这是因为我使用的是1.0版的无人机吗?
发布于 2015-04-27 19:47:10
AR.Drone 1.0处理视频的方式与AR.Drone的2.0版本不同。根据AR.Drone开发人员指南的说法
如果没有大量的工作,您将无法使用节点-ar-无人机库访问视频流:
但实际上,几乎可以肯定的是,最好的选择就是简单地购买一个AR.Drone 2.0 (到2015年4月以300美元左右的价格买到),并使用其他人支持和使用的现有代码。
https://stackoverflow.com/questions/29000544
复制相似问题