denghongcai / node-framebuffer

A framebuffer wrapper for Node.js
MIT License
13 stars 8 forks source link

Can i use node to get screenshot from framebuffer raw #1

Open iBongiornor opened 6 years ago

iBongiornor commented 6 years ago

Hi Mr.Deng:

I'm finding some infomation about converting framebuffer raw data to a screenshot, I find your work here coincidently. Can i get screenshot from framebuffer raw using node。js ? Could i get some hit from your exprience? thank you

denghongcai commented 6 years ago

https://github.com/denghongcai/node-framebuffer/blob/master/lib/framebuffer.js#L46

actually, node-framebuffer already mmapped fb for you, you can directly read from it.

iBongiornor commented 6 years ago

thanks for feedback, is that the whole pixel data in the raw data? and additionally, it seems that i failed in installing node-framebuffer when ‘npm i’ runs into “mmap-io”

gyp ERR! node -v v8.11.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mmap-io@0.1.6 install: `g++ --version; node-gyp configure && node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mmap-io@0.1.6 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

it seems not the version in the package.json

denghongcai commented 6 years ago

is that the whole pixel data in the raw data? yes

please paste whole log here, not the last few lines.

iBongiornor commented 6 years ago

emmmm, the error is very long, i think you can check the attachment error.log

iBongiornor commented 6 years ago

a very strange thing , I tried on macOS and linux both, I only successfully pass the process of install under the root of linux, while i get failed under macOS and non-root user of linux.

the log is the non-root user's log file

denghongcai commented 6 years ago

mmap-io version may related to V8 version, maybe your node version is too high.