forgeByAcision / node-sumo

A Node.js client for controlling Parrot Jumping Sumo drones.
Other
29 stars 12 forks source link

Can not receive stream video from sumo #2

Closed haphamtheanh closed 9 years ago

haphamtheanh commented 9 years ago

Hi, I used your program and i'm very happy with it. But, i can't see image from my sumo, i used console.log(data) in function getVideoStream() and nothing data receive. Best regards, ANH Ha Pham The

pdunkley commented 9 years ago

Hello,

The getVideoStream() function returns a JavaScript stream object that will contain the MJPEG video stream frames as they are received by the library.

There is an example of it in use in the function at the end of this file: https://github.com/forgeByAcision/forge-sumo/blob/master/forgeAS/forge-app.js

Regards,

Peter

haphamtheanh commented 9 years ago

Hello Peter, Thank you yours answer. But, i can't receive stream frames MJPEG video from jumping sumo now. Do i need to send command enable video to it in the first ? Best regards, ANH Ha Pham The

pdunkley commented 9 years ago

Hello,

You don't have to do anything to enable the video. The JavaScript stream object will contain the MJPEG stream. However, because this is a stream object you need an appropriate consumer for it, you can't just call console.log().

You need to either pass the stream into something appropriate (as per the example I gave above where the fluent-ffmpeg library takes in a stream object) or create an appropriate consumer yourself. You can see an example of how to create an appropriate consumer in the "move.js" example that is part of the project.

Regards,

Peter