Mjpg streamer input_libcamera.cpp.o errors

  1. Where did you get the camera module(s)?
    amazon

  2. Model number of the product(s)?
    B0371

  3. What hardware/platform were you working on?
    pi4

  4. Instructions you have followed. (link/manual/etc.)
    " Using libcamera & imx519 on OctoPi"

  5. Problems you were having?
    errors when compiling mjpeg streamer with libcamera input plugin

  6. The dmesg log from your hardware?
    6.527869] imx519 10-001a: Device found is imx519
    [ 6.529050] imx519 10-001a: Consider updating driver imx519 to match on endpoints

  7. Troubleshooting attempts you’ve made?

  8. What help do you need?
    Why is it showing error listed below ?


[ 55%] Building CXX object plugins/input_libcamera/CMakeFiles/input_libcamera.dir/input_libcamera.cpp.o
/home/pi/mj/mjpg-streamer/mjpg-streamer-experimental/plugins/input_libcamera/input_libcamera.cpp:71:5: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
   71 |     " Help for input plugin..: "INPUT_PLUGIN_NAME"\n" \
      |     ^
/home/pi/mj/mjpg-streamer/mjpg-streamer-experimental/plugins/input_libcamera/input_libcamera.cpp: In function ‘int input_cmd(int, unsigned int, unsigned int, int)’:
/home/pi/mj/mjpg-streamer/mjpg-streamer-experimental/plugins/input_libcamera/input_libcamera.cpp:422:38: error: ‘AfTrigger’ is not a member of ‘libcamera::controls::draft’; did you mean ‘libcamera::controls::AfTrigger’?
  422 |       controls_.set(controls::draft::AfTrigger, 1);
      |                                      ^~~~~~~~~
In file included from /home/pi/mj/mjpg-streamer/mjpg-streamer-experimental/plugins/input_libcamera/LibCamera.h:21,
                 from /home/pi/mj/mjpg-streamer/mjpg-streamer-experimental/plugins/input_libcamera/input_libcamera.cpp:31:
/usr/include/libcamera/libcamera/control_ids.h:163:31: note: ‘libcamera::controls::AfTrigger’ declared here
  163 | extern const Control<int32_t> AfTrigger;
      |                               ^~~~~~~~~
make[3]: *** [plugins/input_libcamera/CMakeFiles/input_libcamera.dir/build.make:82: plugins/input_libcamera/CMakeFiles/input_libcamera.dir/input_libcamera.cpp.o] Error 1
make[3]: Leaving directory '/home/pi/mj/mjpg-streamer/mjpg-streamer-experimental/_build'
make[2]: *** [CMakeFiles/Makefile2:475: plugins/input_libcamera/CMakeFiles/input_libcamera.dir/all] Error 2
make[2]: Leaving directory '/home/pi/mj/mjpg-streamer/mjpg-streamer-experimental/_build'
make[1]: *** [Makefile:149: all] Error 2
make[1]: Leaving directory '/home/pi/mj/mjpg-streamer/mjpg-streamer-experimental/_build'
make: *** [Makefile:19: all] Error 2
[email protected]:~/mj/mjpg-streamer/mjpg-streamer-experimental $


Thank you,

Hi, @veetek22

Have you installed the latest Libcamera-DEV, which is the 0.0.8 version.

As the naming space where AFTRIGGER is located in the latest Libcamera has changed, this problem has occurred.

I’m sorry to bring you trouble, we will repair this issue as soon as possible.

Yes , libcamera-dev is at version 0.0.8

anything I can do to fix it ?

what are my options ?

Good Morning @yang , anything I can change in the files to make it work ?

Hi, @veetek22

We have updated the Libcamera plugin of MJPG-Streamer.

You can refer to the following link manual compilation execution:

Hello @yang, I have just tested the changes done to libcamera, and I am now getting this error:

/home/pi/mjpg-streamer-libcamera/mjpg-streamer-experimental/plugins/input_libcamera/input_libcamera.cpp:71:5: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
     " Help for input plugin..: "INPUT_PLUGIN_NAME"\n" \
     ^
/home/pi/mjpg-streamer-libcamera/mjpg-streamer-experimental/plugins/input_libcamera/input_libcamera.cpp: In function ‘int input_cmd(int, unsigned int, unsigned int, int)’:
/home/pi/mjpg-streamer-libcamera/mjpg-streamer-experimental/plugins/input_libcamera/input_libcamera.cpp:422:31: error: ‘AfTrigger’ is not a member of ‘libcamera::controls’
       controls_.set(controls::AfTrigger, 0);
                               ^~~~~~~~~
/home/pi/mjpg-streamer-libcamera/mjpg-streamer-experimental/plugins/input_libcamera/input_libcamera.cpp:422:31: note: suggested alternative:
In file included from /home/pi/mjpg-streamer-libcamera/mjpg-streamer-experimental/plugins/input_libcamera/LibCamera.h:21,
                 from /home/pi/mjpg-streamer-libcamera/mjpg-streamer-experimental/plugins/input_libcamera/input_libcamera.cpp:31:
/usr/include/libcamera/libcamera/control_ids.h:140:31: note:   ‘libcamera::controls::draft::AfTrigger’
 extern const Control<int32_t> AfTrigger;
                               ^~~~~~~~~
make[3]: *** [plugins/input_libcamera/CMakeFiles/input_libcamera.dir/build.make:63: plugins/input_libcamera/CMakeFiles/input_libcamera.dir/input_libcamera.cpp.o] Error 1
make[3]: Leaving directory '/home/pi/mjpg-streamer-libcamera/mjpg-streamer-experimental/_build'
make[2]: *** [CMakeFiles/Makefile2:384: plugins/input_libcamera/CMakeFiles/input_libcamera.dir/all] Error 2
make[2]: Leaving directory '/home/pi/mjpg-streamer-libcamera/mjpg-streamer-experimental/_build'
make[1]: *** [Makefile:130: all] Error 2
make[1]: Leaving directory '/home/pi/mjpg-streamer-libcamera/mjpg-streamer-experimental/_build'
make: *** [Makefile:19: all] Error 2

It is occurring in the same part of the code

@yang, If I implement the suggested change, it solves that error, however I encountered a new error:

/home/pi/mjpg-streamer-libcamera/mjpg-streamer-experimental/plugins/input_libcamera/input_libcamera.cpp:71:5: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
     " Help for input plugin..: "INPUT_PLUGIN_NAME"\n" \
     ^
[ 62%] Building CXX object plugins/input_libcamera/CMakeFiles/input_libcamera.dir/LibCamera.cpp.o
/home/pi/mjpg-streamer-libcamera/mjpg-streamer-experimental/plugins/input_libcamera/LibCamera.cpp: In member function ‘int LibCamera::startCapture()’:
/home/pi/mjpg-streamer-libcamera/mjpg-streamer-experimental/plugins/input_libcamera/LibCamera.cpp:118:38: error: ‘const class libcamera::FileDescriptor’ has no member named ‘get’
                             plane.fd.get(), 0);
                                      ^~~
/home/pi/mjpg-streamer-libcamera/mjpg-streamer-experimental/plugins/input_libcamera/LibCamera.cpp:119:41: error: ‘const class libcamera::FileDescriptor’ has no member named ‘get’
                 mappedBuffers_[plane.fd.get()] =
                                         ^~~
/home/pi/mjpg-streamer-libcamera/mjpg-streamer-experimental/plugins/input_libcamera/LibCamera.cpp: In member function ‘bool LibCamera::readFrame(LibcameraOutData*)’:
/home/pi/mjpg-streamer-libcamera/mjpg-streamer-experimental/plugins/input_libcamera/LibCamera.cpp:208:54: error: ‘const class libcamera::FileDescriptor’ has no member named ‘get’
                 void *data = mappedBuffers_[plane.fd.get()].first;
                                                      ^~~
make[3]: *** [plugins/input_libcamera/CMakeFiles/input_libcamera.dir/build.make:76: plugins/input_libcamera/CMakeFiles/input_libcamera.dir/LibCamera.cpp.o] Error 1
make[3]: Leaving directory '/home/pi/mjpg-streamer-libcamera/mjpg-streamer-experimental/_build'
make[2]: *** [CMakeFiles/Makefile2:384: plugins/input_libcamera/CMakeFiles/input_libcamera.dir/all] Error 2
make[2]: Leaving directory '/home/pi/mjpg-streamer-libcamera/mjpg-streamer-experimental/_build'
make[1]: *** [Makefile:130: all] Error 2
make[1]: Leaving directory '/home/pi/mjpg-streamer-libcamera/mjpg-streamer-experimental/_build'
make: *** [Makefile:19: all] Error 2

EDIT: I made the changes suggested in this post https://forum.arducam.com/t/problem-compiling-mjpg-streamer-on-buster/2737 and I was able to compile!

@rsmith9945

are you work now?

1 Like

Hello @Edward, yes after installing the recommended octoprint version, and following this guide, I was able to get it to work! I am using a raspberry pi zero, so my camera stream kept freezing so I had to make a change recommended in this article Webcam freezing after a few seconds - Webcams - OctoPrint Community Forum and now everything works perfectly!