jean343 / Node-OpenMAX

Node wrapper for the OpenMAX library
https://www.npmjs.com/package/openmax
MIT License
16 stars 5 forks source link

Unable to run examples #1

Closed Alan01252 closed 8 years ago

Alan01252 commented 8 years ago

Hi Jean,

I've been trying to use this library without success. I'm pretty sure I'm being dumb but can't figure out what :).

How do I run the examples? When I run

node examples/SimpleJPEGToVideo.js

I get "cannot find module ../" presumably this is because index is a typescript file at this point? ( This could be rubbish )

I've also tried to include openmax and run the ImageDecoder but when I do so I get

agricamifu:APP TypeError: this.init is not a function at Object.ImageDecode (/srv/opt/agricameraifu/lib/node_modules/openmax/dist/lib/components/ImageDecode.js:13:14) at VideoStream._write (/srv/opt/agricameraifu/lib/camerarecorder/motionDetector.js:91:36) at doWrite (_stream_writable.js:292:12) at writeOrBuffer (_stream_writable.js:278:5) at VideoStream.Writable.write (_stream_writable.js:207:11) at MotionStream.ondata (stream.js:31:26) at emitOne (events.js:90:13) at MotionStream.emit (events.js:182:7) at MotionStream.sendFrame (/srv/opt/agricameraifu/lib/camerarecorder/jpegMotionDetector.js:156:10) +169ms

Which is caused by this line:

       ` that.imageDecode = omx.ImageDecode();`

Any help would be greatly appreciated.

Thanks

Alan

jean343 commented 8 years ago

Hello,

I did try to run my samples against the latest npm and it does fail with a similar error. While I am trying to fix it, please try the older js-only samples in the repository I created for you

Just run the following on your pi:

git clone https://github.com/jean343/Node-OpenMAX-Samples.git cd Node-OpenMAX-Samples npm install node index

You may try other samples as well.

Also, let me know if you are interested in my new version, it supports typescript so you can get hints in your compiler. I made it work with Netbeans and Atom. It's also more asynchronous so the performance is better, I could play an array of videos with it. Unfortunately, I ran in an issue with OMX where it would deadlock with multiple buffers.

Let me know how it works.

Alan01252 commented 8 years ago

Hi Jean,

Thank you!!!

We're very interested in getting this working :) We're using the PI a lot and would love to use this as FFMPEG doesn't have hardware support for encoding. I'd imagine this library would be very popular if people could find it ( it took me a while to know what to search for ) there's a lot of people trying to do this type of stuff on the PI! :)

Thanks again for releasing this, I'll have a play later.

p.s I really need to learn about typescript etc... the joys of programming always so much to learn!

jean343 commented 8 years ago

Hello,

I updated the npm version and I made the samples easier to execute.

To run the JavaScript samples: git clone https://github.com/jean343/Node-OpenMAX.git cd Node-OpenMAX/examples/js/ npm install node SimpleVideoDecoderRender

To run the TypeScript samples: git clone https://github.com/jean343/Node-OpenMAX.git cd Node-OpenMAX/examples/ts/ npm install ./node_modules/typescript/bin/tsc node dist/SimpleVideoDecoderRender

Let me know if they work!

JP