Motion-Project / motionplus

MotionPlus Home Page: https://motion-project.github.io/
GNU General Public License v3.0
319 stars 40 forks source link

Ubuntu 24.04 Beta / FFmpeg7.0 - compile error #136

Closed axeljerabek closed 7 months ago

axeljerabek commented 7 months ago

Did you read the guide?

Yes

What is the base version number of MotionPlus being used?

0.1.x

What was the install method?

Built from source code

What is base architecture?

x86/x64

What is the distro being used?

Ubuntu

Disto version number

24.04 Beta

Camera/Sound type(s) being used?

Network camera with RTSP

Describe the issue/problem and steps to reproduce

If I compile motionplus, I get this error:

webu_mpegts.cpp: In function ‘int webu_mpegts_pic_send(ctx_webui, unsigned char)’: webu_mpegts.cpp:73:25: warning: ‘AVFrame::key_frame’ is deprecated [-Wdeprecated-declarations] 73 webui->picture->key_frame = 1; ^~~~~ In file included from /usr/include/x86_64-linux-gnu/libavformat/avformat.h:327, from motionplus.hpp:64, from webu_mpegts.cpp:19: /usr/include/x86_64-linux-gnu/libavutil/frame.h:440:9: note: declared here 440 int key_frame; ^~~~~ webu_mpegts.cpp:73:25: warning: ‘AVFrame::key_frame’ is deprecated [-Wdeprecated-declarations] 73 webui->picture->key_frame = 1; ^~~~~ /usr/include/x86_64-linux-gnu/libavutil/frame.h:440:9: note: declared here 440 int key_frame; ^~~~~ webu_mpegts.cpp:73:25: warning: ‘AVFrame::key_frame’ is deprecated [-Wdeprecated-declarations] 73 webui->picture->key_frame = 1; ^~~~~ /usr/include/x86_64-linux-gnu/libavutil/frame.h:440:9: note: declared here 440 int key_frame; ^~~~~ webu_mpegts.cpp: In function ‘int webu_mpegts_open(ctx_webui)’: webu_mpegts.cpp:332:17: error: invalid conversion from ‘int ()(void, uint8_t, int)’ {aka ‘int ()(void, unsigned char, int)’} to ‘int ()(void, const uint8_t, int)’ {aka ‘int ()(void, const unsigned char*, int)’} [-fpermissive] 332 , NULL, &webu_mpegts_avio_buf, NULL); ^~~~~
int ()(void, uint8_t, int) {aka int ()(void, unsigned char, int)}

In file included from /usr/include/x86_64-linux-gnu/libavformat/avformat.h:319: /usr/include/x86_64-linux-gnu/libavformat/avio.h:404:25: note: initializing argument 6 of ‘AVIOContext avio_alloc_context(unsigned char, int, int, void, int ()(void, uint8_t, int), int ()(void, const uint8_t, int), int64_t ()(void, int64_t, int))’ 404 | int (write_packet)(void opaque, const uint8_t buf, int buf_size), | ~~^~~~~~~~~~~~~ make[2]: [Makefile:497: webu_mpegts.o] Fehler 1 make[2]: Verzeichnis „/home/axel/dev/motionplus/src“ wird verlassen make[1]: [Makefile:567: all-recursive] Fehler 1 make[1]: Verzeichnis „/home/axel/dev/motionplus“ wird verlassen make: *** [Makefile:411: all] Fehler 2

FFmpeg7.0 compiled from source and runs fine. Would be nice if you could have a look at it. Thanks! :)

Relevant MotionPlus log output (at log_level 8)

none
Mr-Dave commented 7 months ago

I'm in the middle of something right now but I'd guess that this line static int webu_mpegts_avio_buf(void *opaque, uint8_t *buf, int buf_size)

needs to change to

static int webu_mpegts_avio_buf(void *opaque, const uint8_t *buf, int buf_size)

If that doesn't solve it (or there are more issues), it will be a bit of time before I'd be able to get them resolved.

axeljerabek commented 7 months ago

wow, you are quick! 🗡️

Seems that there is another one also:

webu_mpegts.cpp: In function ‘int webu_mpegts_pic_send(ctx_webui, unsigned char)’: webu_mpegts.cpp:73:25: warning: ‘AVFrame::key_frame’ is deprecated [-Wdeprecated-declarations] 73 webui->picture->key_frame = 1; ^~~~~ In file included from /usr/include/x86_64-linux-gnu/libavformat/avformat.h:327, from motionplus.hpp:64, from webu_mpegts.cpp:19: /usr/include/x86_64-linux-gnu/libavutil/frame.h:436:9: note: declared here 436 int key_frame; ^~~~~ webu_mpegts.cpp:73:25: warning: ‘AVFrame::key_frame’ is deprecated [-Wdeprecated-declarations] 73 webui->picture->key_frame = 1; ^~~~~ /usr/include/x86_64-linux-gnu/libavutil/frame.h:436:9: note: declared here 436 int key_frame; ^~~~~ webu_mpegts.cpp:73:25: warning: ‘AVFrame::key_frame’ is deprecated [-Wdeprecated-declarations] 73 webui->picture->key_frame = 1; ^~~~~ /usr/include/x86_64-linux-gnu/libavutil/frame.h:436:9: note: declared here 436 int key_frame; ^~~~~ webu_mpegts.cpp: In function ‘int webu_mpegts_open(ctx_webui)’: webu_mpegts.cpp:332:17: error: invalid conversion from ‘int ()(void, const uint8_t, int)’ {aka ‘int ()(void, const unsigned char, int)’} to ‘int ()(void, uint8_t, int)’ {aka ‘int ()(void, unsigned char*, int)’} [-fpermissive] 332 , NULL, &webu_mpegts_avio_buf, NULL); ^~~~~
int ()(void, const uint8_t, int) {aka int ()(void, const unsigned char, int)}

In file included from /usr/include/x86_64-linux-gnu/libavformat/avformat.h:319: /usr/include/x86_64-linux-gnu/libavformat/avio.h:420:25: note: initializing argument 6 of ‘AVIOContext avio_alloc_context(unsigned char, int, int, void, int ()(void, uint8_t, int), int ()(void, uint8_t, int), int64_t ()(void, int64_t, int))’ 420 | int (write_packet)(void opaque, uint8_t buf, int buf_size), | ~~^~~~~~~~~~~~~~~ make[2]: [Makefile:497: webu_mpegts.o] Fehler 1 make[2]: Verzeichnis „/home/axel/dev/motionplus/src“ wird verlassen make[1]: [Makefile:567: all-recursive] Fehler 1 make[1]: Verzeichnis „/home/axel/dev/motionplus“ wird verlassen make: *** [Makefile:411: all] Fehler 2

axeljerabek commented 7 months ago

No, seems to be the same even. Sorry. Take your time, not in a hurry :)

axeljerabek commented 7 months ago

Any progress? Did you find the bug? Just curious :)

axeljerabek commented 7 months ago

Ok, that one is gone. Still, I got another one:

g++ -std=c++17 -o motionplus alg.o alg_sec.o conf.o dbse.o draw.o event.o exif.o jpegutils.o libcam.o logger.o motionplus.o motion_loop.o movie.o netcam.o picture.o rotate.o sound.o util.o video_v4l2.o video_common.o video_loopback.o webu.o webu_file.o webu_html.o webu_json.o webu_post.o webu_stream.o webu_mpegts.o -pthread -ljpeg -lmicrohttpd -lwebpmux -lwebp -lcamera -lcamera-base -lavutil -lavformat -lavcodec -lswscale -lavdevice -L/usr/local/lib -lopencv_gapi -lopencv_stitching -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dnn_superres -lopencv_dpm -lopencv_face -lopencv_freetype -lopencv_fuzzy -lopencv_hfs -lopencv_img_hash -lopencv_intensity_transform -lopencv_line_descriptor -lopencv_mcc -lopencv_quality -lopencv_rapid -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_superres -lopencv_optflow -lopencv_surface_matching -lopencv_tracking -lopencv_highgui -lopencv_datasets -lopencv_text -lopencv_plot -lopencv_videostab -lopencv_videoio -lopencv_wechat_qrcode -lopencv_xfeatures2d -lopencv_shape -lopencv_ml -lopencv_ximgproc -lopencv_video -lopencv_xobjdetect -lopencv_objdetect -lopencv_calib3d -lopencv_imgcodecs -lopencv_features2d -lopencv_dnn -lopencv_flann -lopencv_xphoto -lopencv_photo -lopencv_imgproc -lopencv_core -L/usr/lib/x86_64-linux-gnu/ -lmariadb -lpulse -pthread -lpulse-simple -lasound -lfftw3 /usr/bin/ld: Warnung: libIlmImf-2_5.so.25, benötigt von /usr/local/lib/libopencv_imgcodecs.so, nicht gefunden (versuchen Sie mit using -rpath oder -rpath-link) /usr/bin/ld: Warnung: libSvtAv1Enc.so.0, benötigt von /lib/x86_64-linux-gnu/libavfilter.so.9, nicht gefunden (versuchen Sie mit using -rpath oder -rpath-link) /usr/bin/ld: /usr/local/lib/libopencv_imgcodecs.so: undefined reference to Imf_2_5::Header::Header(int, int, float, Imath_2_5::Vec2<float> const&, float, Imf_2_5::LineOrder, Imf_2_5::Compression)' /usr/bin/ld: /usr/local/lib/libopencv_imgcodecs.so: undefined reference toImf_2_5::InputFile::header() const' /usr/bin/ld: /usr/local/lib/libopencv_imgcodecs.so: undefined reference to Imf_2_5::Chromaticities::Chromaticities(Imath_2_5::Vec2<float> const&, Imath_2_5::Vec2<float> const&, Imath_2_5::Vec2<float> const&, Imath_2_5::Vec2<float> const&)' /usr/bin/ld: /usr/local/lib/libopencv_imgcodecs.so: undefined reference toImf_2_5::globalThreadCount()' /usr/bin/ld: /usr/local/lib/libopencv_imgcodecs.so: undefined reference to Imf_2_5::OutputFile::writePixels(int)' /usr/bin/ld: /usr/local/lib/libopencv_imgcodecs.so: undefined reference toImf_2_5::hasChromaticities(Imf_2_5::Header const&)' /usr/bin/ld: /usr/local/lib/libopencv_imgcodecs.so: undefined reference to Imf_2_5::Channel::Channel(Imf_2_5::PixelType, int, int, bool)' /usr/bin/ld: /usr/local/lib/libopencv_imgcodecs.so: undefined reference toImf_2_5::Header::channels() const' /usr/bin/ld: /usr/local/lib/libopencv_imgcodecs.so: undefined reference to Imf_2_5::Header::compression()' /usr/bin/ld: /usr/local/lib/libopencv_imgcodecs.so: undefined reference toImf_2_5::InputFile::InputFile(char const, int)' /usr/bin/ld: /usr/local/lib/libopencv_imgcodecs.so: undefined reference to Imf_2_5::InputFile::readPixels(int, int)' /usr/bin/ld: /usr/local/lib/libopencv_imgcodecs.so: undefined reference toImf_2_5::FrameBuffer::begin()' /usr/bin/ld: /usr/local/lib/libopencv_imgcodecs.so: undefined reference to Imf_2_5::FrameBuffer::end()' /usr/bin/ld: /usr/local/lib/libopencv_imgcodecs.so: undefined reference toImf_2_5::Header::dataWindow() const' /usr/bin/ld: /usr/local/lib/libopencv_imgcodecs.so: undefined reference to Imf_2_5::OutputFile::~OutputFile()' /usr/bin/ld: /usr/local/lib/libopencv_imgcodecs.so: undefined reference toImf_2_5::Header::~Header()' /usr/bin/ld: /usr/local/lib/libopencv_imgcodecs.so: undefined reference to Imf_2_5::chromaticities(Imf_2_5::Header const&)' /usr/bin/ld: /usr/local/lib/libopencv_imgcodecs.so: undefined reference toImf_2_5::InputFile::setFrameBuffer(Imf_2_5::FrameBuffer const&)' /usr/bin/ld: /usr/local/lib/libopencv_imgcodecs.so: undefined reference to `Imf_2_5::OutputFile::OutputFile(char const, Imf_2_5::Header const&, int)' /usr/bin/ld: /usr/local/lib/libopencv_imgcodecs.so: undefined reference to Imf_2_5::Header::channels()' /usr/bin/ld: /usr/local/lib/libopencv_imgcodecs.so: undefined reference toImf_2_5::ChannelList::insert(char const, Imf_2_5::Channel const&)' /usr/bin/ld: /usr/local/lib/libopencv_imgcodecs.so: undefined reference to `Imf_2_5::FrameBuffer::insert(char const, Imf_2_5::Slice const&)' /usr/bin/ld: /usr/local/lib/libopencv_imgcodecs.so: undefined reference to Imf_2_5::ChannelList::findChannel(char const*) const' /usr/bin/ld: /usr/local/lib/libopencv_imgcodecs.so: undefined reference toImf_2_5::Slice::Slice(Imf_2_5::PixelType, char*, unsigned long, unsigned long, int, int, double, bool, bool)' /usr/bin/ld: /usr/local/lib/libopencv_imgcodecs.so: undefined reference to `Imf_2_5::OutputFile::setFrameBuffer(Imf_2_5::FrameBuffer const&)' collect2: error: ld returned 1 exit status make[2]: [Makefile:453: motionplus] Fehler 1 make[2]: Verzeichnis „/home/axel/dev/motionplus/src“ wird verlassen make[1]: [Makefile:567: all-recursive] Fehler 1 make[1]: Verzeichnis „/home/axel/dev/motionplus“ wird verlassen make: *** [Makefile:411: all] Fehler 2

I have to check that with opencv it seems.