PSDK 3.5 on Debian 12 --> avcodec issues
CompletedHello,
I've setup a new develpement environment. Which is based on Debian 12.
When I compile the PSDK 3.5 demo applications there is a problem in the dji_camera_stream_decoder.cpp.
The output of cmake ..:
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- Found OPUS installed in the system
-- - Includes: /usr/include/opus
-- - Libraries: /usr/lib/x86_64-linux-gnu/libopus.so
-- Found LIBUSB installed in the system
-- - Includes: /usr/include/libusb-1.0
-- - Libraries: /usr/lib/x86_64-linux-gnu/libusb-1.0.so
dji_sdk_demo_linux_cxx...
-- Found OpenCV installed in the system, will use it to display image in AdvancedSensing APIs
-- - Includes: /usr/include/opencv4
-- - Libraries: opencv_calib3d;opencv_core;opencv_dnn;opencv_features2d;opencv_flann;opencv_highgui;opencv_imgcodecs;opencv_imgproc;opencv_ml;opencv_objdetect;opencv_photo;opencv_stitching;opencv_video;opencv_videoio;opencv_alphamat;opencv_aruco;opencv_barcode;opencv_bgsegm;opencv_bioinspired;opencv_ccalib;opencv_cvv;opencv_datasets;opencv_dnn_objdetect;opencv_dnn_superres;opencv_dpm;opencv_face;opencv_freetype;opencv_fuzzy;opencv_hdf;opencv_hfs;opencv_img_hash;opencv_intensity_transform;opencv_line_descriptor;opencv_mcc;opencv_optflow;opencv_phase_unwrapping;opencv_plot;opencv_quality;opencv_rapid;opencv_reg;opencv_rgbd;opencv_saliency;opencv_shape;opencv_stereo;opencv_structured_light;opencv_superres;opencv_surface_matching;opencv_text;opencv_tracking;opencv_videostab;opencv_viz;opencv_wechat_qrcode;opencv_ximgproc;opencv_xobjdetect;opencv_xphoto
-- Found FFMPEG installed in the system
-- - Includes: /usr/include/x86_64-linux-gnu
-- - Libraries: /usr/lib/x86_64-linux-gnu/libavcodec.so;/usr/lib/x86_64-linux-gnu/libavformat.so;/usr/lib/x86_64-linux-gnu/libavutil.so;/usr/lib/x86_64-linux-gnu/libswscale.so;/usr/lib/x86_64-linux-gnu/libz.so
-- - Version: 4.1.11-0+deb10u1
-- Found OPUS installed in the system
-- - Includes: /usr/include/opus
-- - Libraries: /usr/lib/x86_64-linux-gnu/libopus.so
-- Found LIBUSB installed in the system
-- - Includes: /usr/include/libusb-1.0
-- - Libraries: /usr/lib/x86_64-linux-gnu/libusb-1.0.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/c5uav/Payload-SDK-3.5/build
At the make command the following errors are mentioned:
[ 47%] Building CXX object samples/sample_c++/platform/linux/manifold2/CMakeFiles/dji_sdk_demo_linux_cxx.dir/__/__/__/module_sample/liveview/dji_camera_stream_decoder.cpp.o
/home/c5uav/Payload-SDK-3.5/samples/sample_c++/module_sample/liveview/dji_camera_stream_decoder.cpp: In member function ‘bool DJICameraStreamDecoder::init()’:
/home/c5uav/Payload-SDK-3.5/samples/sample_c++/module_sample/liveview/dji_camera_stream_decoder.cpp:81:5: error: ‘avcodec_register_all’ was not declared in this scope
81 | avcodec_register_all();
| ^~~~~~~~~~~~~~~~~~~~
/home/c5uav/Payload-SDK-3.5/samples/sample_c++/module_sample/liveview/dji_camera_stream_decoder.cpp:88:34: error: invalid conversion from ‘const AVCodec*’ to ‘AVCodec*’ [-fpermissive]
88 | pCodec = avcodec_find_decoder(AV_CODEC_ID_H264);
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
| |
| const AVCodec*
/home/c5uav/Payload-SDK-3.5/samples/sample_c++/module_sample/liveview/dji_camera_stream_decoder.cpp: In member function ‘void DJICameraStreamDecoder::decodeBuffer(const uint8_t*, int)’:
/home/c5uav/Payload-SDK-3.5/samples/sample_c++/module_sample/liveview/dji_camera_stream_decoder.cpp:194:19: warning: ‘void av_init_packet(AVPacket*)’ is deprecated [-Wdeprecated-declarations]
194 | av_init_packet(&pkt);
| ~~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:45,
from /home/c5uav/Payload-SDK-3.5/samples/sample_c++/module_sample/liveview/dji_camera_stream_decoder.hpp:33,
from /home/c5uav/Payload-SDK-3.5/samples/sample_c++/module_sample/liveview/dji_camera_stream_decoder.cpp:26:
/usr/include/x86_64-linux-gnu/libavcodec/packet.h:512:6: note: declared here
512 | void av_init_packet(AVPacket *pkt);
| ^~~~~~~~~~~~~~
/home/c5uav/Payload-SDK-3.5/samples/sample_c++/module_sample/liveview/dji_camera_stream_decoder.cpp:210:13: error: ‘avcodec_decode_video2’ was not declared in this scope; did you mean ‘avcodec_decode_subtitle2’?
210 | avcodec_decode_video2(pCodecCtx, pFrameYUV, &gotPicture, &pkt);
| ^~~~~~~~~~~~~~~~~~~~~
| avcodec_decode_subtitle2
/home/c5uav/Payload-SDK-3.5/samples/sample_c++/module_sample/liveview/dji_camera_stream_decoder.cpp:227:31: error: ‘avpicture_get_size’ was not declared in this scope
227 | bufSize = avpicture_get_size(AV_PIX_FMT_RGB24, w, h);
| ^~~~~~~~~~~~~~~~~~
/home/c5uav/Payload-SDK-3.5/samples/sample_c++/module_sample/liveview/dji_camera_stream_decoder.cpp:229:37: error: ‘AVPicture’ was not declared in this scope; did you mean ‘gotPicture’?
229 | avpicture_fill((AVPicture *) pFrameRGB, rgbBuf, AV_PIX_FMT_RGB24, w, h);
| ^~~~~~~~~
| gotPicture
/home/c5uav/Payload-SDK-3.5/samples/sample_c++/module_sample/liveview/dji_camera_stream_decoder.cpp:229:48: error: expected primary-expression before ‘)’ token
229 | avpicture_fill((AVPicture *) pFrameRGB, rgbBuf, AV_PIX_FMT_RGB24, w, h);
| ^
/home/c5uav/Payload-SDK-3.5/samples/sample_c++/module_sample/liveview/dji_camera_stream_decoder.cpp:229:21: error: ‘avpicture_fill’ was not declared in this scope
229 | avpicture_fill((AVPicture *) pFrameRGB, rgbBuf, AV_PIX_FMT_RGB24, w, h);
| ^~~~~~~~~~~~~~
/home/c5uav/Payload-SDK-3.5/samples/sample_c++/module_sample/liveview/dji_camera_stream_decoder.cpp:246:5: error: ‘av_free_packet’ was not declared in this scope; did you mean ‘av_new_packet’?
246 | av_free_packet(&pkt);
| ^~~~~~~~~~~~~~
| av_new_packet
make[2]: *** [samples/sample_c++/platform/linux/manifold2/CMakeFiles/dji_sdk_demo_linux_cxx.dir/build.make:636: samples/sample_c++/platform/linux/manifold2/CMakeFiles/dji_sdk_demo_linux_cxx.dir/__/__/__/module_sample/liveview/dji_camera_stream_decoder.cpp.o] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:170: samples/sample_c++/platform/linux/manifold2/CMakeFiles/dji_sdk_demo_linux_cxx.dir/all] Fehler 2
make: *** [Makefile:136: all] Fehler 2
According to the Cmake output the FFMPEG was downgraded to verion 4.1.11.
BR,
Michael
Please sign in to leave a comment.
Comments
3 comments