Permalink
Browse files

import

  • Loading branch information...
0 parents commit ad05dff955d24147655278ccf7ad04f7756a263f @bkw committed Oct 12, 2012
Showing with 149 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +32 −0 .jshintrc
  3. +39 −0 README.md
  4. +37 −0 ffserver.conf
  5. +13 −0 index.html
  6. +10 −0 package.json
  7. +17 −0 stream.js
@@ -0,0 +1 @@
+node_modules
@@ -0,0 +1,32 @@
+{
+ "es5" : true,
+
+ "browser" : false,
+ "boss" : true,
+ "curly": true,
+ "debug": false,
+ "devel": true,
+ "eqeqeq": true,
+ "evil": false,
+ "forin": true,
+ "immed": true,
+ "indent": 4,
+ "jquery": true,
+ "laxbreak": false,
+ "laxcomma": true,
+ "newcap": true,
+ "noarg": false,
+ "noempty": true,
+ "nonew": true,
+ "nomen": false,
+ "onevar": true,
+ "plusplus": false,
+ "regexp": false,
+ "trailing": true,
+ "undef": true,
+ "sub": false,
+ "strict": true,
+ "globalstrict": true,
+ "white": true,
+ "node" : true
+}
@@ -0,0 +1,39 @@
+## nodecopter-stream
+
+html5 live stream from your
+[Parrot AR Drone 2.0](http://ardrone2.parrot.com/).
+
+This is a proof of concept implementation using ffmpeg and ffserver and
+a webm live stream.
+
+You need a recend version of ffmpeg (together with ffserver) installed.
+
+
+Install via Github to get the *latest* version:
+
+```bash
+npm install git://github.com/bkw/nodecopter-stream.git
+```
+
+Launch the server:
+```bash
+node stream.js
+```
+
+... and then open index.html in a recent browser (firefox, chrome, opera).
+
+
+##TODO
+
+* implement more stream types (HLS!)
+
+* compensate tcp latency by dropping frames until the last I-Frame in the
+ buffer, see:
+ * https://projects.ardrone.org/boards/1/topics/show/4282,
+ * https://projects.ardrone.org/attachments/450/paveparse.zip
+
+* experiment with different encodings, bitrates and other ffserver settings
+
+* make sure ffserver exists on process exit
+
+* reduce CPU usage of node (suspect: parsing frames that could be dropped)
@@ -0,0 +1,37 @@
+Port 8090
+BindAddress 0.0.0.0
+MaxHTTPConnections 2000
+MaxClients 1000
+MaxBandwidth 1000
+CustomLog -
+NoDaemon
+
+<Feed nodecopter.ffm>
+#File data/nodecopter.ffm
+#FileMaxSize 500K
+</Feed>
+
+
+<Stream nodecopter.webm>
+Feed nodecopter.ffm
+Format webm
+#VideoFrameRate 30
+VideoCodec libvpx
+VideoSize 640x368
+#VideoBitRate 384k
+VideoQMin 1
+VideoQMax 31
+Preroll 15
+StartSendOnKey
+AVOptionVideo flags +global_header
+NoAudio
+</Stream>
+
+<Stream status.html>
+Format status
+</Stream>
+
+<Redirect index.html>
+URL status.html
+</Redirect>
+
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <title>NodeCopter live streaming example</title>
+ </head>
+ <body>
+ <video width="640" height="368" autoplay="autoplay">
+ <source src="http://localhost:8090/nodecopter.webm?buffer=5" type='video/webm; codecs="vp8, vorbis"' />
+ Video tag not supported.
+ </video>
+ </body>
+</html>
@@ -0,0 +1,10 @@
+{
+ "name": "nodecopter-stream",
+ "version": "0.0.1",
+ "scripts": {
+ "start": "stream.js"
+ },
+ "dependencies": {
+ "ar-drone": "https://github.com/bkw/node-ar-drone/tarball/master"
+ }
+}
@@ -0,0 +1,17 @@
+#!/usr/bin/env node
+
+'use strict';
+
+var arDrone = require('ar-drone')
+ , parser = new arDrone.PaVEParser()
+ , spawn = require('child_process').spawn
+ , tcpVideoStream = new arDrone.Client.PngStream.TcpVideoStream()
+ , feedUrl = 'http://localhost:8090/nodecopter.ffm'
+ , ffmpeg = spawn('ffmpeg', ['-i', '-', feedUrl])
+ , ffserver = spawn('ffserver', ['-f', __dirname + '/ffserver.conf'])
+ ;
+
+parser.pipe(ffmpeg.stdin);
+tcpVideoStream.pipe(parser);
+tcpVideoStream.connect();
+

0 comments on commit ad05dff

Please sign in to comment.