Comments (19)
that is pretty easy, but I would not suggest taking the detour with the pngs.
Basically want you want is the TcpVideoStream piped through PaVEParser then into a writeStream.
This way you record perfectly clean h264 frames straight to disk.
You can later add an mp4 container to these files like this:
ffmpeg -i recordedstream.h264 -vcodec copy out.mp4
l-smash is also very good for adding a container to h264:
muxer -i recordedstream.h264 --optimize-pd --file-format mp4 -o out.mp4
from node-ar-drone.
If you want the video to be streaming to a browser, take a look at ar-drone-png-stream or node-dronestream for realtime video.
from node-ar-drone.
I have a stream set up via canvas and the PNGStream already - just trying to get the record feature right. Is PaVEParser exposed or should I just clone the code into my local?
from node-ar-drone.
I don't think it's exposed. I thought, I had a pull request for that...
The PngStream doesn't use the PaVEDecoder, it just pipes everything to ffmpeg, hoping it will sort it out - which works most of the time.
If you want a real clean solution, I'd rather take the PaVEDecoder from node-dronestream, pipe in the tcpstream, and then hook both a recorder and a pngencoder to it. The pngencoder should also benefit from the filtered stream than PaVE delivers.
from node-ar-drone.
I'm getting a black video after running it through ffmpeg - the duration looks correct though. Here is my code so far (using your PaVEDecoder)
video = drone.createPngStream()
out = fs.createWriteStream './vid.h246'
parser = new PaVEParser
video._tcpVideoStream.pipe parser.pipe out
from node-ar-drone.
Using code similar to whats in dronestream ffmpeg returns vid.h246: Invalid data found when processing input
out = require('fs').createWriteStream './vid.h246'
parser = new PaVEParser
parser.pipe out
tcpVideoStream = new arDrone.Client.PngStream.TcpVideoStream timeout: 4000
tcpVideoStream.on 'error', console.log
tcpVideoStream.connect ->
tcpVideoStream.pipe parser
from node-ar-drone.
strange. Have you looked at the recorded file? It should start with 00 00 00 01.
Do you the newest version of buffy? I think node-ar-drone still comes with an older one that doesn't have skip().
Sorry, only guessing...
from node-ar-drone.
you should be able to check the recorded stream with ffplay (comes with ffmpeg) also, it can play raw h264.
from node-ar-drone.
The h246 file starts with 6742 801e 8b68 0a02
Everything is at the latest - will try ffplay
from node-ar-drone.
reproduced. Very strange, I swear this worked. Let me check for a second.
from node-ar-drone.
Ahhh, sorry! I sent you on a wrong track! I optimized out the NAL-Headers for my Version of PaVE-Parser!
Sorry for wasting your time!
from node-ar-drone.
But it just confirmed it works with the PaVE-Parser from node-ar-drone.
from node-ar-drone.
I (earlier) recorded a video stream like this:
% nc 192.168.1.1 5555 > recorded.pave
and here is a pave to h264 converter:
var fs = require('fs');
var PaVEParser = require('./lib/video/PaVEParser');
fs.createReadStream('recorded.pave')
.pipe(new PaVEParser())
.pipe(fs.createWriteStream('out.h264'));
out.h264 is both usable by ffplayer and ffmpeg.
from node-ar-drone.
If I pipe the TCP stream -> PaVE -> file I get a file full of [object Object][object Object][object Object]
Changing this.emit('data', this._frame);
to this.emit('data', this._frame.payload);
fixes the issue - I think the client should expose a getRawVideoStream function that does this process
from node-ar-drone.
Glad it worked out in the end.
Apologies for the misleading information, I was confusing my many versions of the PaVEParser.
Since PeVEParser is not exposed and not used by any other project that I know of, I propose just changing it to emit a frame
event with the frame data, and regular data
events with the h264 payload for streaming.
I think this version does this.
I'm sick right now and find it hard to concentrate, I'll try to get it right later.
from node-ar-drone.
Changed the title to add exposing raw video stream. I think moving the tcp video stream up to the client and piping it to the pngstream/paveparser/whatever would be more accessible than having it within the pngstream
from node-ar-drone.
Changed the title to add exposing raw video stream. I think moving the tcp video stream up to the client and piping it to the pngstream/paveparser/whatever would be more accessible than having it within the pngstream
So you're suggesting to add drone.createTcpStream()
? I'm 100% for this / looking forward to a patch : )
from node-ar-drone.
Hi Everyone,
I'm trying to built in an application that transforms the several canvas objects dynamically and constantly created into an h264 video stream.
I'm working with node.js now (but i can change).
Can you please suggest me the best way to to this?
Thanks in advance.
Eduardo
from node-ar-drone.
Following the latest refactoring of client.getVideoStream, and the added example, I propose to close this thread. Re-open if not happy with it :-)
from node-ar-drone.
Related Issues (20)
- Vision Detect..TypeError: Cannot read property 'nbDetected' of undefined HOT 8
- pngstream stops sending new images after sometime HOT 3
- How do I access just the gps.latitude property? HOT 5
- How can i get the only navdata - magneto data ?
- How to add delay to navdata read, and make real time graph? HOT 4
- is bebop 2 supported
- Can I disable the ultrasonic sensor? HOT 1
- use gps to make a path HOT 1
- drones to fly using the google maps
- Multiple clients - multiple drones communicate through nodejs server HOT 2
- Troubleshooting 'undefined' error HOT 1
- TcpVideoStream timeout HOT 2
- when trying to npm install ar-drone
- pngStream only sends one image to browser
- Error: Cannot find module 'simple-debug' HOT 1
- Error: Ffmpeg exited with error code: null
- Cannot perform a counter clockwise rotation
- IDE
- External sensors HOT 1
- Feeding PngStream to openCV
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-ar-drone.