kerberos-io / machinery

(DEPRECATED) An open source image processing framework, which uses your USB-, IP- or RPi-camera to recognize events (e.g. motion).
https://www.kerberos.io
490 stars 104 forks source link

undefined reference to `mmal_util_rgb_order_fixed' #66

Closed mishab closed 7 years ago

mishab commented 7 years ago

Tried building the project and got this error message:

/home/pi/machinery/build/thirdparty/lib/libraspicam_cv.a(private_impl.cpp.o): In function raspicam::_private::Private_Impl::create_camera_component(raspicam::_ private::RASPIVID_STATE*)': private_impl.cpp:(.text._ZN8raspicam8_private12Private_Impl23create_camera_compo nentEPNS0_14RASPIVID_STATEE+0x58): undefined reference tommal_util_rgb_order_fixed' collect2: ld returned 1 exit status src/CMakeFiles/kerberosio.dir/build.make:562: recipe for target '../bin/kerberos io' failed make[2]: [../bin/kerberosio] Error 1 CMakeFiles/Makefile2:1140: recipe for target 'src/CMakeFiles/kerberosio.dir/all' failed make[1]: [src/CMakeFiles/kerberosio.dir/all] Error 2 Makefile:143: recipe for target 'all' failed make: *** [all] Error 2

cedricve commented 7 years ago

Did you updated / upgraded your Raspbian version?

mishab commented 7 years ago

I did "sudo apt-get update && sudo apt-get upgrade". Seems to be up-to date. Anything else I might be missing? Building dependency tree Reading state information... Done The following packages have been kept back: nuscratch 0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. pi@raspberrypi ~ $

cedricve commented 7 years ago

Can you provide me with more logging?

mishab commented 7 years ago

Would be happy to provide logging. What do you need? Meanwhile I nuked the directory and restarted building everything from scratch

cedricve commented 7 years ago

Looks like you don't have the latest mmal libraries installed..

https://github.com/raspberrypi/userland/blob/master/interface/mmal/util/mmal_util.h

cedricve commented 7 years ago

Van you verify the mmal_util_rgb_order_fixed method is in place?

mishab commented 7 years ago

I thought cmake will do it for me(External-RaspiCam.cmake) and pull the raspicam repo ( ${git_protocol}://github.com/cedricve/raspicam ) it appears that raspicamera is throwing an error during the build. pi@raspberrypi ~/machinery/build/raspicamera $ sudo make [ 71%] Built target raspicam Linking CXX executable raspicam_still_test ../src/libraspicam.so.0.1.2: undefined reference to `mmal_util_rgb_order_fixed' collect2: ld returned 1 exit status utils/CMakeFiles/raspicam_still_test.dir/build.make:89: recipe for target 'utils/raspicam_still_test' failed make[2]: [utils/raspicam_still_test] Error 1 CMakeFiles/Makefile2:158: recipe for target 'utils/CMakeFiles/raspicam_still_test.dir/all' failed make[1]: [utils/CMakeFiles/raspicam_still_test.dir/all] Error 2 Makefile:113: recipe for target 'all' failed make: *** [all] Error 2 pi@raspberrypi ~/machinery/build/raspicamera $

then when i navigate to /dependencies/mmal and try to build from there i get this error pi@raspberrypi ~/machinery/build/raspicamera/dependencies/mmal $ sudo make [ 1%] Building C object core/CMakeFiles/mmal_core.dir/mmal_format.o /home/pi/machinery/build/raspicamera/dependencies/mmal/core/mmal_format.c:28:24: fatal error: mmal_types.h: No such file or directory compilation terminated. core/CMakeFiles/mmal_core.dir/build.make:54: recipe for target 'core/CMakeFiles/mmal_core.dir/mmal_format.o' failed make[2]: [core/CMakeFiles/mmal_core.dir/mmal_format.o] Error 1 CMakeFiles/Makefile2:113: recipe for target 'core/CMakeFiles/mmal_core.dir/all' failed make[1]: [core/CMakeFiles/mmal_core.dir/all] Error 2 Makefile:113: recipe for target 'all' failed make: *** [all] Error 2 pi@raspberrypi ~/machinery/build/raspicamera/dependencies/mmal $

it looks like it can't find the .h file. probably the CMakeLists is not correct. Investigating.

cedricve commented 7 years ago

Weird, can you try to build this repository directly https://github.com/cedricve/raspicam? On which RPi are you trying to build?

cedricve commented 7 years ago

@mishab can you show me the version of your cmake?

pi@raspberrypi:~/machinery/build $ cmake -version cmake version 3.6.2

mishab commented 7 years ago

same. 3.6.2 do you know what causes this build error? what version of ffmpeg is required?

[ 77%] Linking CXX executable ../../bin/kerberosio ../thirdparty/lib/libopencv_videoio.a(cap_ffmpeg.cpp.o): In function CvVideoWriter_FFMPEG::open(char const*, int, double, int, int, bool)': cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiib+0x2dc): undefined reference toavformat_get_mov_video_tags' collect2: error: ld returned 1 exit status src/CMakeFiles/kerberosio.dir/build.make:594: recipe for target '../bin/kerberosio' failed make[2]: [../bin/kerberosio] Error 1 CMakeFiles/Makefile2:1187: recipe for target 'src/CMakeFiles/kerberosio.dir/all' failed make[1]: [src/CMakeFiles/kerberosio.dir/all] Error 2 Makefile:160: recipe for target 'all' failed make: *** [all] Error 2 pi@raspberrypi-3:~/machinery/build $ cmake -version cmake version 3.6.2

cedricve commented 7 years ago

I confirm that there is an issue on ARM if you have FFMPEG installed. Looks like the avformat_get_mov_video_tagsfunction is missing. However when you just install libav-tools on your RPi it should work (without compiling ffmpeg). You should try to remove the FFMPEG installation with all extensions, and just rely on libav-tools.

mishab commented 7 years ago

Cedric, I was able to figure everything out, except for VideoCapture. I am using Raspberry Pi 3, but when I configure kerberos to use VideoCapture, OpenCV errors out with the following error: GStreamer Error opening bin 0. I see that the VideoCapture path is 0, which seems to be the correct index for my USB camera. Any idea why OpenCV can’t open camera at index 0, while ffmpeg is capturing video just fine: pi@raspberrypi-3:~/machinery/build $ sudo ffmpeg -f v4l2 -framerate 25 -video_size 1920x1080 -i /dev/video0 /etc/opt/kerberosio/capture/output.mp4

pi@raspberrypi-3:~/machinery/build $ ffmpeg -f v4l2 -list_formats all -i /dev/video0 ffmpeg version 3.1.1 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 4.9.2 (Raspbian 4.9.2-10) configuration: libavutil 55. 28.100 / 55. 28.100 libavcodec 57. 48.101 / 57. 48.101 libavformat 57. 41.100 / 57. 41.100 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 47.100 / 6. 47.100 libswscale 4. 1.100 / 4. 1.100 libswresample 2. 1.100 / 2. 1.100 [video4linux2,v4l2 @ 0x2ee11b0] Compressed: mjpeg : Motion-JPEG : 1920x1080 1280x720 1024x768 640x480 800x600 1280x1024 320x240 [video4linux2,v4l2 @ 0x2ee11b0] Raw : yuyv422 : YUYV 4:2:2 : 1920x1080 1280x720 1024x768 640x480 800x600 1280x1024 320x240 /dev/video0: Immediate exit requested pi@raspberrypi-3:~/machinery/build $

cedricve commented 7 years ago

You need to select USBcamera, instead of Videocapture. The videocapture is for debugging purposes, you can specify a video file, and let it processing by Kerberos.io just like it was a real-time capture device.

So what was the issue?

touchardv commented 7 years ago

Hi, I recently tried to also upgrade my Pi with the latest version of Kerberos (great job btw) and also had an issue with libmmal (missing symbol: undefined symbol: mmal_util_rgb_order_fixed). I ran all updates/upgrade, but the lib is still the same... How is it supposed to be updated on Raspbian?

cedricve commented 7 years ago

@touchardv which version did you installed, on which Pi?

touchardv commented 7 years ago

That was machinery version 2.2.0 and the Pi is the 2 model B running on: 4.4.0-1-rpi2 #1 SMP Debian 4.4.6-1+rpi14 (2016-05-05) armv7l GNU/Linux

Tried update/upgrade/dist-upgrade but nothing seemed to change that mmal library.

cedricve commented 7 years ago

Did you already tried on a fresh installation?

On 20 Mar 2017, at 08:55, Vincentoo notifications@github.com wrote:

That was machinery version 2.2.0 and the Pi is the 2 model B running on: 4.4.0-1-rpi2 #1 https://github.com/kerberos-io/machinery/issues/1 SMP Debian 4.4.6-1+rpi14 (2016-05-05) armv7l GNU/Linux

Tried update/upgrade/dist-upgrade but nothing seemed to change that mmal library.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/kerberos-io/machinery/issues/66#issuecomment-287694723, or mute the thread https://github.com/notifications/unsubscribe-auth/ABeaG6meHGpBwpJakDjpjbV0BhAJFIoBks5rnjDugaJpZM4LfvDh.

touchardv commented 7 years ago

I did not try a fresh installation. The Pi was re-installed beginning of January 2017 with a fresh Raspbian network installation.

cedricve commented 7 years ago

@touchardv just tried out myself with a Pi2 model B, and cannot reproduce with latest raspbian installation..

touchardv commented 7 years ago

I think I know what is wrong: the image I used: https://github.com/debian-pi/raspbian-ua-netinst I used the release 1.0.9 there and it looks a bit old. But then, still wondering, how can one update this libmmal?

cedricve commented 7 years ago

@touchardv any update?

touchardv commented 7 years ago

I am planning to re-re-install the Pi when I have time, probably in the coming days. I ll post an update then.

touchardv commented 7 years ago

I can confirm that the latest release (2.2.1) works just fine on a fresh Raspbian installation (Raspbian Jessie Lite from https://www.raspberrypi.org/downloads/raspbian/). So clearly there is something in the previous version I was using (https://github.com/debian-pi/raspbian-ua-netinst) that was installing an old version of this library... I guess?

Anyway, thanks for checking and support.