mjpg-streamer icon indicating copy to clipboard operation
mjpg-streamer copied to clipboard

Not getting input_raspicam when compiling on 64bit raspbian

Open xamindar opened this issue 4 years ago • 20 comments

This doesn't seem to be compiling everything when I try on 64 but Raspbian. I am not seeing any errors either.

pi@raspberrypi4:~/mjpg-streamer/mjpg-streamer-experimental $ make [ -d _build ] || mkdir _build [ -f _build/Makefile ] || (cd _build && cmake -DCMAKE_BUILD_TYPE=Release ..) make -C _build make[1]: Entering directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' make[2]: Entering directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' make[3]: Entering directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' make[3]: Leaving directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' make[3]: Entering directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' [ 4%] Building C object CMakeFiles/mjpg_streamer.dir/mjpg_streamer.c.o [ 8%] Building C object CMakeFiles/mjpg_streamer.dir/utils.c.o [ 13%] Linking C executable mjpg_streamer make[3]: Leaving directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' [ 13%] Built target mjpg_streamer make[3]: Entering directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' make[3]: Leaving directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' make[3]: Entering directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' [ 17%] Building C object plugins/input_file/CMakeFiles/input_file.dir/input_file.c.o [ 21%] Linking C shared library input_file.so make[3]: Leaving directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' [ 21%] Built target input_file make[3]: Entering directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' make[3]: Leaving directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' make[3]: Entering directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' [ 26%] Building C object plugins/input_http/CMakeFiles/input_http.dir/input_http.c.o [ 30%] Building C object plugins/input_http/CMakeFiles/input_http.dir/misc.c.o [ 34%] Building C object plugins/input_http/CMakeFiles/input_http.dir/mjpg-proxy.c.o [ 39%] Linking C shared library input_http.so make[3]: Leaving directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' [ 39%] Built target input_http make[3]: Entering directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' make[3]: Leaving directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' make[3]: Entering directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' [ 43%] Building C object plugins/input_uvc/CMakeFiles/input_uvc.dir/dynctrl.c.o [ 47%] Building C object plugins/input_uvc/CMakeFiles/input_uvc.dir/input_uvc.c.o [ 52%] Building C object plugins/input_uvc/CMakeFiles/input_uvc.dir/jpeg_utils.c.o [ 56%] Building C object plugins/input_uvc/CMakeFiles/input_uvc.dir/v4l2uvc.c.o [ 60%] Linking C shared library input_uvc.so make[3]: Leaving directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' [ 60%] Built target input_uvc make[3]: Entering directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' make[3]: Leaving directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' make[3]: Entering directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' [ 65%] Building C object plugins/output_file/CMakeFiles/output_file.dir/output_file.c.o [ 69%] Linking C shared library output_file.so make[3]: Leaving directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' [ 69%] Built target output_file make[3]: Entering directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' make[3]: Leaving directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' make[3]: Entering directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' [ 73%] Building C object plugins/output_http/CMakeFiles/output_http.dir/httpd.c.o [ 78%] Building C object plugins/output_http/CMakeFiles/output_http.dir/output_http.c.o [ 82%] Linking C shared library output_http.so make[3]: Leaving directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' [ 82%] Built target output_http make[3]: Entering directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' make[3]: Leaving directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' make[3]: Entering directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' [ 86%] Building C object plugins/output_rtsp/CMakeFiles/output_rtsp.dir/output_rtsp.c.o [ 91%] Linking C shared library output_rtsp.so make[3]: Leaving directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' [ 91%] Built target output_rtsp make[3]: Entering directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' make[3]: Leaving directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' make[3]: Entering directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' [ 95%] Building C object plugins/output_udp/CMakeFiles/output_udp.dir/output_udp.c.o [100%] Linking C shared library output_udp.so make[3]: Leaving directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' [100%] Built target output_udp make[2]: Leaving directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' make[1]: Leaving directory '/home/pi/mjpg-streamer/mjpg-streamer-experimental/_build' pi@raspberrypi4:~/mjpg-streamer/mjpg-streamer-experimental $

xamindar avatar Jul 05 '20 19:07 xamindar

Have you tried running make distclean first?

jacksonliam avatar Jul 06 '20 07:07 jacksonliam

Yes I have, but it doesn't work. "make clean" works:

pi@raspberrypi4:~/mjpg-streamer/mjpg-streamer-experimental $ make distclean make: *** No rule to make target 'distclean'. Stop.

xamindar avatar Jul 07 '20 22:07 xamindar

I also pulled down a fresh repo and still does not build that file: Is it possible any of the following are not really optional as it says?

-- The following OPTIONAL packages have not been found:

  • OpenCV
  • Gphoto2
  • SDL

OK, here we go, but not sure what it needs:

  • PLUGIN_INPUT_RASPICAM, Raspberry Pi input camera plugin (unmet dependencies)

xamindar avatar Jul 07 '20 23:07 xamindar

OK, it looks like this package looks for includes in a non-standard location. I got it to build by working around with a symlink: ln -s /usr/include /opt/vc/ ln -s /usr/lib/aarch64-linux-gnu /opt/vc/lib

This is mentioned here: https://www.raspberrypi.org/forums/viewtopic.php?t=275370 "2) libraspberrypi0, libraspberrypi-dev and libraspberrypi-doc have been moved out of /opt/vc/* and into /usr/* instead (making it more standard). Any code built against these libraries will require changing to refer to a more standard location (/usr/lib/ rather than /opt/vc/lib)"

It looks like it builds, but when run, it just segfaults.

xamindar avatar Jul 07 '20 23:07 xamindar

Thanks that's useful info.

It might be that the headers we have had to include in this repo to build against mmal need updating for 64 bit.

I assume the other, non input_raspicam modules work? You can test out input_uvc wih a raspi cam by running

modprobe bcm2835-v4l

jacksonliam avatar Jul 08 '20 07:07 jacksonliam

I posted about it in the pi forums and someone said mmal is not yet working on 64bit raspbian. So I guess that's that.

I wasn't aware you could use input_uvc, thanks. However, I was unable to get that to work. When I try, i just get a constant scroll of "Ignoring empty buffer ..." going down the screen.

Looking in to it further, I was able to successfully capture an image using the v4l2-ctl command. So I know the camera does work.

xamindar avatar Jul 08 '20 12:07 xamindar

OK thanks for the info. Sounds like the part of bcm2835-v4l we need isnt working either, if it's just delivering empty buffers. Even if v4l2-ctl is able to create an image.

jacksonliam avatar Jul 08 '20 12:07 jacksonliam

Hey :) I'm running into the same issues. So far, getting the latest and greatest Pi was a big mistake. ^^ I edited plugins/input_raspicam/CMakeLists.txt to make it compile. But it segmentation faults. (mmal issue?) Do we have to wait until the 64 bit framework is available? or did someone find a workaround? Thanks all!! :)

gulbrillo avatar Jul 19 '20 02:07 gulbrillo

Any news on this?

guysoft avatar Dec 17 '20 14:12 guysoft

@guysoft I can't really do anything about input-raspicam until MMAL is supported on the 64-bit OS which I don't think it is yet?

I believe mjpg-streamer build correctly detects this and does not build the plugin. So no errors or failures to build are seen as far as I know?

V4L2 using the input-uvc plugin and the raspberry pi cam v4l2 driver should still work IIRC? I believe it is out of the box on your 0.18 RC1.

Cheers!

jacksonliam avatar Dec 18 '20 15:12 jacksonliam

Came across this and guess might be helpful https://github.com/jacksonliam/mjpg-streamer/issues/203#issuecomment-484513852

esmaeilpour avatar Jan 13 '21 21:01 esmaeilpour

According to @esmaeilpour simply installing libraspberrypi-dev package should make it compile.

guysoft avatar Jan 18 '21 13:01 guysoft

According to @esmaeilpour simply installing libraspberrypi-dev package should make it compile.

Probably pulling in the headers will compile the plugin but I believe it still won't work at runtime on 64 bit.

jacksonliam avatar Jan 18 '21 17:01 jacksonliam

libraspberrypi-dev

Did not help.

FredLackeyOfficial avatar Jan 20 '21 23:01 FredLackeyOfficial

any update on this? im also not getting input_raspicam

nymda avatar Jan 11 '22 21:01 nymda

just want to leave a note here in case anybody ends up here. Even for 32 bit it does not build input_raspicam.so because of the moving of the libraries.

The easiest way to solve this is by just modifying the CMakeLists.txt from mjpg-streamer/mjpg-streamer-experimental/plugins/input_raspicam and change all paths "opt/vc" for "usr".

mcr222 avatar Jan 28 '22 21:01 mcr222

I found this issue when trying to use 'input_raspicam'. I can confirm that input-uvc does work instead on the 64bit raspberry pi os:

mjpg_streamer -o “output_http.so -w ./www” -i “input_uvc.so -rot 180 -r 1280×720 -fps 15”

lukeallister avatar Feb 13 '22 03:02 lukeallister

just want to leave a note here in case anybody ends up here. Even for 32 bit it does not build input_raspicam.so because of the moving of the libraries.

The easiest way to solve this is by just modifying the CMakeLists.txt from mjpg-streamer/mjpg-streamer-experimental/plugins/input_raspicam and change all paths "opt/vc" for "usr".

I am on a 32-bit OS, and creating a symbolic link with sudo ln -s /usr /opt/vc following by a make distclean works for me. Seems that somehow the include path has changed.

alephO avatar Feb 19 '22 05:02 alephO

I am on a 32-bit OS, and creating a symbolic link with sudo ln -s /usr /opt/vc following by a make distclean works for me. Seems that somehow the include path has changed.

I'm getting compiler warnings when I compile the input_raspicam plugin after making this symlink, however the raspicam plugin seems to be running normally! Just for context/knowledge, why is there a discrepancy in the headers between what's expected, and what is installed on Raspbian?

sseshan7 avatar May 22 '22 21:05 sseshan7

sudo apt-get install libraspberrypi-dev That works!

Note that I'm on 4B+ with Linux ubuntu 5.4.0-1069-raspi #79-Ubuntu SMP PREEMPT Thu Aug 18 18:15:22 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux instead of original rasberry system, current system can be downloaded in official website.

Mactarvish avatar Sep 28 '22 15:09 Mactarvish