dturing / node-gstreamer-superficial

Superficial gstreamer binding
MIT License
127 stars 45 forks source link

Node-gyp rebuild fails on npm install - gstappsink.h No such file or directory #51

Closed nickrobillard closed 2 years ago

nickrobillard commented 2 years ago

Versions

Node v12.22.6 Npm 6.14.15 Raspbian 11 Bullseye on Raspberry Pi 4b

Gstreamer packages installed ``` $ apt list --installed | grep gst gir1.2-gstreamer-1.0/stable,now 1.18.4-2.1 armhf [installed,automatic] gstreamer1.0-alsa/stable,now 1.18.4-2 armhf [installed] gstreamer1.0-gl/stable,now 1.18.4-2 armhf [installed,automatic] gstreamer1.0-libav/stable,now 1.18.4-3 armhf [installed] gstreamer1.0-omx-generic-config/stable,now 1.18.3-1 armhf [installed] gstreamer1.0-omx-generic/stable,now 1.18.3-1 armhf [installed,automatic] gstreamer1.0-opencv/stable,now 1.18.4-3 armhf [installed] gstreamer1.0-plugins-bad/stable,now 1.18.4-3 armhf [installed] gstreamer1.0-plugins-base-apps/stable,now 1.18.4-2 armhf [installed] gstreamer1.0-plugins-base/stable,now 1.18.4-2 armhf [installed] gstreamer1.0-plugins-good/stable,now 1.18.4-2 armhf [installed] gstreamer1.0-plugins-ugly/stable,now 1.18.4-2 armhf [installed] gstreamer1.0-rtsp/stable,now 1.18.4-2 armhf [installed] gstreamer1.0-tools/stable,now 1.18.4-2.1 armhf [installed,automatic] gstreamer1.0-vaapi/stable,now 1.18.4-2 armhf [installed] gstreamer1.0-wpe/stable,now 1.18.4-3 armhf [installed] gstreamer1.0-x/stable,now 1.18.4-2 armhf [installed,automatic] libgstreamer-gl1.0-0/stable,now 1.18.4-2 armhf [installed,automatic] libgstreamer-opencv1.0-0/stable,now 1.18.4-3 armhf [installed,automatic] libgstreamer-plugins-bad1.0-0/stable,now 1.18.4-3 armhf [installed,automatic] libgstreamer-plugins-base1.0-0/stable,now 1.18.4-2 armhf [installed,automatic] libgstreamer1.0-0/stable,now 1.18.4-2.1 armhf [installed,automatic] libgstreamer1.0-dev/stable,now 1.18.4-2.1 armhf [installed] libgstrtspserver-1.0-0/stable,now 1.18.4-2 armhf [installed,automatic] ```

The problem

Hi, I'm getting a node-gyp compile error when I run npm install in the root of the master branch. I first encountered the problem in https://github.com/dturing/node-gstreamer-superficial/issues/22, but quickly resolved by installing package libgstreamer1.0-dev. Now I am seeing ../GObjectWrap.cpp:3:10: fatal error: gst/app/gstappsink.h: No such file or directory. Here is the full output:

$ npm install

> gstreamer-superficial@1.7.3 install /home/broadcaster/node-gstreamer-superficial
> node-gyp rebuild

make: Entering directory '/home/broadcaster/node-gstreamer-superficial/build'
  CXX(target) Release/obj.target/gstreamer-superficial/gstreamer.o
  CXX(target) Release/obj.target/gstreamer-superficial/GLibHelpers.o
  CXX(target) Release/obj.target/gstreamer-superficial/GObjectWrap.o
../GObjectWrap.cpp:3:10: fatal error: gst/app/gstappsink.h: No such file or directory
    3 | #include <gst/app/gstappsink.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [gstreamer-superficial.target.mk:122: Release/obj.target/gstreamer-superficial/GObjectWrap.o] Error 1
make: Leaving directory '/home/broadcaster/node-gstreamer-superficial/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/broadcaster/.nvm/versions/node/v12.22.6/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Linux 5.10.52-v7l+
gyp ERR! command "/home/broadcaster/.nvm/versions/node/v12.22.6/bin/node" "/home/broadcaster/.nvm/versions/node/v12.22.6/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/broadcaster/node-gstreamer-superficial
gyp ERR! node -v v12.22.6
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gstreamer-superficial@1.7.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the gstreamer-superficial@1.7.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/broadcaster/.npm/_logs/2021-09-12T21_41_46_618Z-debug.log

As you can see in the Gstreamer package versions above, I have Gstreamer 1.18 installed. Any ideas what this error is caused by?

dturing commented 2 years ago

If you google for raspbian gstappsink.h, you'll find hints to a package called libgstreamer-plugins-base1.0-dev, please try installing that.

nickrobillard commented 2 years ago

Awesome, thank you, installing libgstreamer-plugins-base1.0-dev solved it. I have the streaming example working now. Very excited to use this!

dturing commented 2 years ago

great, thanks for coming back to close the ticket :)