Still have issues with gstreamer running from web server

I have decided to revisit a long-standing issue with launching anything from apache or nginx trying to access nvarguscamerasrc.

My test case is to just grab a screenshot:
“gst-launch-1.0 nvarguscamerasrc num-buffers=1 ! ‘video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12’ ! nvjpegenc ! filesink location=/var/www/html/test.jpg -e”

When I launch this as my normal user, root or even as www-data it runs fine from a SSH shell and grabs the screenshot. If, however, I launch it from PHP using exec function all I get is this:
“Error: Can’t initialize nvrm channel
Error: Can’t initialize nvrm channel
Couldn’t create ddkvic Session: Cannot allocate memory
nvbuf_utils: Could not create Default NvBufferSession
Error: Can’t initialize nvrm channel
Error: Can’t initialize nvrm channel
Couldn’t create ddkvic Session: Cannot allocate memory
nvbuf_utils: Could not create Default NvBufferSession
WARNING: erroneous pipeline: no element “nvarguscamerasrc””

I have tried apache and nginx and both do the same thing. I have ran nginx as root, www-data and even my normal user called robot1. If this process launches from the webserver it will not work.

Earlier work seemed to indicate this was a systemd issue as anything launched from that would give this same error. However, I recently updated to the newest L4T and now I cannot use my old workaround. I used to be able to stop the webserver process and launch it from a command prompt and it would work. Now it seems to be broken permenantly.

There has got to be a reason why I cannot launch any camera commands from a webserver. This has me stopped dead in my tracks now. I have done considerable troubleshooting with permissions and things and cannot make heads or tails out of it.

Ideas???

Hi,
Please check if you include this path:

/usr/lib/aarch64-linux-gnu/gstreamer-1.0

Our gstreamer plugins are built into prebuilt libs and put is this folder. Seems like you don’t include prebuilt libs in the folders so are not able to see the plugins.