Thanks again, but unfortunately i couldn’t even build the changes you made to the source files. When building i get a ton of undefined reference to
:
...
[ 13%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_mjpeg_encoder.cpp.o
[ 13%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_mjpeg_decoder.cpp.o
[ 13%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/backend_plugin.cpp.o
[ 13%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/backend_static.cpp.o
[ 13%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/container_avi.cpp.o
[ 13%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_v4l.cpp.o
[ 13%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o
[ 13%] Linking CXX shared library ../../lib/libopencv_videoio.so
/usr/bin/ld: CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o: in function `hw_create_derived_context(AVHWDeviceType, AVBufferRef*)::FreeChildContext::free(AVHWDeviceContext*)':
cap_ffmpeg.cpp:(.text._ZZL25hw_create_derived_context14AVHWDeviceTypeP11AVBufferRefEN16FreeChildContext4freeEP17AVHWDeviceContext+0x27): undefined reference to `av_buffer_unref(AVBufferRef**)'
/usr/bin/ld: CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o: in function `InternalFFMpegRegister::~InternalFFMpegRegister()':
cap_ffmpeg.cpp:(.text._ZN22InternalFFMpegRegisterD2Ev[_ZN22InternalFFMpegRegisterD5Ev]+0xb): undefined reference to `av_log_set_callback(void (*)(void*, int, char const*, __va_list_tag*))'
/usr/bin/ld: CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o: in function `ffmpeg_log_callback(void*, int, char const*, __va_list_tag*)':
cap_ffmpeg.cpp:(.text._ZL19ffmpeg_log_callbackPviPKcP13__va_list_tag+0x11): undefined reference to `av_log_get_level()'
/usr/bin/ld: CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o: in function `CvCapture_FFMPEG::init()':
cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG4initEv+0x10): undefined reference to `avdevice_register_all()'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG4initEv+0xd0): undefined reference to `av_init_packet(AVPacket*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG4initEv+0x171): undefined reference to `av_init_packet(AVPacket*)'
/usr/bin/ld: CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o: in function `CvCapture_FFMPEG::close()':
cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG5closeEv+0x30): undefined reference to `av_frame_free(AVFrame**)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG5closeEv+0x4e): undefined reference to `avformat_close_input(AVFormatContext**)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG5closeEv+0x5f): undefined reference to `av_frame_unref(AVFrame*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG5closeEv+0x75): undefined reference to `av_packet_unref(AVPacket*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG5closeEv+0x96): undefined reference to `av_dict_free(AVDictionary**)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG5closeEv+0xac): undefined reference to `av_packet_unref(AVPacket*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG5closeEv+0xcd): undefined reference to `av_bsf_free(AVBSFContext**)'
/usr/bin/ld: CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o: in function `CvCapture_FFMPEG::processRawPacket()':
cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG16processRawPacketEv+0x70): undefined reference to `av_packet_unref(AVPacket*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG16processRawPacketEv+0x83): undefined reference to `av_bsf_send_packet(AVBSFContext*, AVPacket*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG16processRawPacketEv+0x9a): undefined reference to `av_bsf_receive_packet(AVBSFContext*, AVPacket*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG16processRawPacketEv+0xde): undefined reference to `av_bsf_get_by_name(char const*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG16processRawPacketEv+0xf2): undefined reference to `av_bsf_alloc(AVBitStreamFilter const*, AVBSFContext**)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG16processRawPacketEv+0x142): undefined reference to `avcodec_parameters_copy(AVCodecParameters*, AVCodecParameters const*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG16processRawPacketEv+0x14e): undefined reference to `av_bsf_init(AVBSFContext*)'
/usr/bin/ld: CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o: in function `CvCapture_FFMPEG::grabFrame() [clone .part.0]':
cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG9grabFrameEv.part.0+0x3e): undefined reference to `avcodec_receive_frame(AVCodecContext*, AVFrame*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG9grabFrameEv.part.0+0x58): undefined reference to `av_packet_unref(AVPacket*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG9grabFrameEv.part.0+0x6d): undefined reference to `av_read_frame(AVFormatContext*, AVPacket*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG9grabFrameEv.part.0+0x94): undefined reference to `av_packet_unref(AVPacket*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG9grabFrameEv.part.0+0xe7): undefined reference to `avcodec_send_packet(AVCodecContext*, AVPacket const*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG9grabFrameEv.part.0+0xf8): undefined reference to `avcodec_receive_frame(AVCodecContext*, AVFrame*)'
/usr/bin/ld: CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o: in function `CvCapture_FFMPEG::getProperty(int) const':
cap_ffmpeg.cpp:(.text._ZNK16CvCapture_FFMPEG11getPropertyEi+0x198): undefined reference to `avcodec_get_name(AVCodecID)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZNK16CvCapture_FFMPEG11getPropertyEi+0x25c): undefined reference to `av_guess_sample_aspect_ratio(AVFormatContext*, AVStream*, AVFrame*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZNK16CvCapture_FFMPEG11getPropertyEi+0x281): undefined reference to `av_guess_sample_aspect_ratio(AVFormatContext*, AVStream*, AVFrame*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZNK16CvCapture_FFMPEG11getPropertyEi+0x2a1): undefined reference to `avcodec_pix_fmt_to_codec_tag(AVPixelFormat)'
/usr/bin/ld: CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o: in function `CvCapture_FFMPEG::seek(long)':
cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG4seekEl+0xcd): undefined reference to `av_seek_frame(AVFormatContext*, int, long, int)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG4seekEl+0xd6): undefined reference to `avcodec_flush_buffers(AVCodecContext*)'
/usr/bin/ld: CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o: in function `hw_create_frames(AVCodecContext*, AVBufferRef*, int, int, AVPixelFormat)':
cap_ffmpeg.cpp:(.text._ZL16hw_create_framesP14AVCodecContextP11AVBufferRefii13AVPixelFormat+0xb1): undefined reference to `avcodec_get_hw_frames_parameters(AVCodecContext*, AVBufferRef*, AVPixelFormat, AVBufferRef**)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZL16hw_create_framesP14AVCodecContextP11AVBufferRefii13AVPixelFormat+0x105): undefined reference to `av_hwframe_ctx_init(AVBufferRef*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZL16hw_create_framesP14AVCodecContextP11AVBufferRefii13AVPixelFormat+0x13b): undefined reference to `av_hwframe_ctx_create_derived(AVBufferRef**, AVPixelFormat, AVBufferRef*, AVBufferRef*, int)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZL16hw_create_framesP14AVCodecContextP11AVBufferRefii13AVPixelFormat+0x147): undefined reference to `av_buffer_unref(AVBufferRef**)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZL16hw_create_framesP14AVCodecContextP11AVBufferRefii13AVPixelFormat+0x19c): undefined reference to `av_hwframe_ctx_init(AVBufferRef*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZL16hw_create_framesP14AVCodecContextP11AVBufferRefii13AVPixelFormat+0x50e): undefined reference to `av_buffer_unref(AVBufferRef**)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZL16hw_create_framesP14AVCodecContextP11AVBufferRefii13AVPixelFormat+0x524): undefined reference to `av_hwframe_ctx_alloc(AVBufferRef*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZL16hw_create_framesP14AVCodecContextP11AVBufferRefii13AVPixelFormat+0x73f): undefined reference to `av_hwdevice_get_hwframe_constraints(AVBufferRef*, void const*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZL16hw_create_framesP14AVCodecContextP11AVBufferRefii13AVPixelFormat+0x75c): undefined reference to `av_hwframe_constraints_free(AVHWFramesConstraints**)'
/usr/bin/ld: CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o: in function `hw_get_format_callback(AVCodecContext*, AVPixelFormat const*)':
cap_ffmpeg.cpp:(.text._ZL22hw_get_format_callbackP14AVCodecContextPK13AVPixelFormat+0xa4): undefined reference to `avcodec_get_hw_config(AVCodec const*, int)'
/usr/bin/ld: CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o: in function `hw_check_codec(AVCodec*, AVHWDeviceType, char const*)':
cap_ffmpeg.cpp:(.text._ZL14hw_check_codecP7AVCodec14AVHWDeviceTypePKc+0x3e): undefined reference to `av_hwdevice_get_type_name(AVHWDeviceType)'
/usr/bin/ld: CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o: in function `hw_find_codec(AVCodecID, AVHWDeviceType, int (*)(AVCodec const*), char const*, AVPixelFormat*)':
cap_ffmpeg.cpp:(.text._ZL13hw_find_codec9AVCodecID14AVHWDeviceTypePFiPK7AVCodecEPKcP13AVPixelFormat+0x44): undefined reference to `av_codec_iterate(void**)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZL13hw_find_codec9AVCodecID14AVHWDeviceTypePFiPK7AVCodecEPKcP13AVPixelFormat+0x7d): undefined reference to `av_codec_is_encoder(AVCodec const*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZL13hw_find_codec9AVCodecID14AVHWDeviceTypePFiPK7AVCodecEPKcP13AVPixelFormat+0x93): undefined reference to `avcodec_get_hw_config(AVCodec const*, int)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZL13hw_find_codec9AVCodecID14AVHWDeviceTypePFiPK7AVCodecEPKcP13AVPixelFormat+0xe9): undefined reference to `av_codec_is_encoder(AVCodec const*)'
/usr/bin/ld: CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o: in function `hw_create_derived_context(AVHWDeviceType, AVBufferRef*)':
cap_ffmpeg.cpp:(.text._ZL25hw_create_derived_context14AVHWDeviceTypeP11AVBufferRef+0x81): undefined reference to `av_hwdevice_get_type_name(AVHWDeviceType)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZL25hw_create_derived_context14AVHWDeviceTypeP11AVBufferRef+0x96): undefined reference to `av_hwdevice_ctx_create_derived(AVBufferRef**, AVHWDeviceType, AVBufferRef*, int)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZL25hw_create_derived_context14AVHWDeviceTypeP11AVBufferRef+0xb4): undefined reference to `av_buffer_unref(AVBufferRef**)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZL25hw_create_derived_context14AVHWDeviceTypeP11AVBufferRef+0x498): undefined reference to `av_buffer_ref(AVBufferRef*)'
/usr/bin/ld: CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o: in function `CvCapture_FFMPEG::retrieveFrame(int, unsigned char**, int*, int*, int*, int*)':
cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG13retrieveFrameEiPPhPiS2_S2_S2_+0x93): undefined reference to `av_frame_alloc()'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG13retrieveFrameEiPPhPiS2_S2_S2_+0xa6): undefined reference to `av_hwframe_transfer_data(AVFrame*, AVFrame const*, int)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG13retrieveFrameEiPPhPiS2_S2_S2_+0x14d): undefined reference to `av_frame_unref(AVFrame*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG13retrieveFrameEiPPhPiS2_S2_S2_+0x16f): undefined reference to `av_frame_get_buffer(AVFrame*, int)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG13retrieveFrameEiPPhPiS2_S2_S2_+0x237): undefined reference to `av_frame_free(AVFrame**)'
/usr/bin/ld: CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o: in function `icv_av_write_frame_FFMPEG(AVFormatContext*, AVStream*, AVCodecContext*, unsigned char*, unsigned int, AVFrame*, int) [clone .constprop.0]':
cap_ffmpeg.cpp:(.text._ZL25icv_av_write_frame_FFMPEGP15AVFormatContextP8AVStreamP14AVCodecContextPhjP7AVFramei.constprop.0+0x8c): undefined reference to `av_packet_alloc()'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZL25icv_av_write_frame_FFMPEGP15AVFormatContextP8AVStreamP14AVCodecContextPhjP7AVFramei.constprop.0+0xa3): undefined reference to `avcodec_receive_packet(AVCodecContext*, AVPacket*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZL25icv_av_write_frame_FFMPEGP15AVFormatContextP8AVStreamP14AVCodecContextPhjP7AVFramei.constprop.0+0xb2): undefined reference to `av_packet_free(AVPacket**)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZL25icv_av_write_frame_FFMPEGP15AVFormatContextP8AVStreamP14AVCodecContextPhjP7AVFramei.constprop.0+0xf6): undefined reference to `av_packet_rescale_ts(AVPacket*, AVRational, AVRational)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZL25icv_av_write_frame_FFMPEGP15AVFormatContextP8AVStreamP14AVCodecContextPhjP7AVFramei.constprop.0+0x103): undefined reference to `av_write_frame(AVFormatContext*, AVPacket*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZL25icv_av_write_frame_FFMPEGP15AVFormatContextP8AVStreamP14AVCodecContextPhjP7AVFramei.constprop.0+0x10e): undefined reference to `av_packet_free(AVPacket**)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZL25icv_av_write_frame_FFMPEGP15AVFormatContextP8AVStreamP14AVCodecContextPhjP7AVFramei.constprop.0+0x127): undefined reference to `avcodec_send_frame(AVCodecContext*, AVFrame const*)'
/usr/bin/ld: CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o: in function `CvVideoWriter_FFMPEG::writeFrame(unsigned char const*, int, int, int, int, int)':
cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG10writeFrameEPKhiiiii+0x186): undefined reference to `av_frame_alloc()'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG10writeFrameEPKhiiiii+0x1a9): undefined reference to `av_hwframe_get_buffer(AVBufferRef*, AVFrame*, int)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG10writeFrameEPKhiiiii+0x1c1): undefined reference to `av_hwframe_transfer_data(AVFrame*, AVFrame const*, int)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG10writeFrameEPKhiiiii+0x200): undefined reference to `av_frame_free(AVFrame**)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG10writeFrameEPKhiiiii+0x244): undefined reference to `av_freep(void*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG10writeFrameEPKhiiiii+0x260): undefined reference to `av_mallocz(unsigned long)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG10writeFrameEPKhiiiii+0x525): undefined reference to `av_frame_free(AVFrame**)'
/usr/bin/ld: CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o: in function `CvVideoWriter_FFMPEG::close()':
cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG5closeEv+0x71): undefined reference to `av_free(void*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG5closeEv+0x7f): undefined reference to `av_free(void*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG5closeEv+0x8d): undefined reference to `avcodec_close(AVCodecContext*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG5closeEv+0x9e): undefined reference to `av_free(void*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG5closeEv+0xb9): undefined reference to `avformat_free_context(AVFormatContext*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG5closeEv+0xc2): undefined reference to `av_freep(void*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG5closeEv+0x17a): undefined reference to `av_write_trailer(AVFormatContext*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG5closeEv+0x1ad): undefined reference to `avio_close(AVIOContext*)'
/usr/bin/ld: CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o: in function `CvVideoWriter_FFMPEG::writeHWFrame(cv::_InputArray const&)':
cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG12writeHWFrameERKN2cv11_InputArrayE+0x41): undefined reference to `av_frame_alloc()'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG12writeHWFrameERKN2cv11_InputArrayE+0x5f): undefined reference to `av_hwframe_get_buffer(AVBufferRef*, AVFrame*, int)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG12writeHWFrameERKN2cv11_InputArrayE+0x7e): undefined reference to `av_frame_free(AVFrame**)'
/usr/bin/ld: CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o: in function `HWAccelIterator::HWAccelIterator(cv::VideoAccelerationType, bool, AVDictionary*)':
cap_ffmpeg.cpp:(.text._ZN15HWAccelIteratorC2EN2cv21VideoAccelerationTypeEbP12AVDictionary[_ZN15HWAccelIteratorC5EN2cv21VideoAccelerationTypeEbP12AVDictionary]+0xb4d): undefined reference to `av_dict_get(AVDictionary const*, char const*, AVDictionaryEntry const*, int)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN15HWAccelIteratorC2EN2cv21VideoAccelerationTypeEbP12AVDictionary[_ZN15HWAccelIteratorC5EN2cv21VideoAccelerationTypeEbP12AVDictionary]+0xcbc): undefined reference to `av_dict_get(AVDictionary const*, char const*, AVDictionaryEntry const*, int)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN15HWAccelIteratorC2EN2cv21VideoAccelerationTypeEbP12AVDictionary[_ZN15HWAccelIteratorC5EN2cv21VideoAccelerationTypeEbP12AVDictionary]+0xd75): undefined reference to `av_dict_get(AVDictionary const*, char const*, AVDictionaryEntry const*, int)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN15HWAccelIteratorC2EN2cv21VideoAccelerationTypeEbP12AVDictionary[_ZN15HWAccelIteratorC5EN2cv21VideoAccelerationTypeEbP12AVDictionary]+0x140e): undefined reference to `av_dict_get(AVDictionary const*, char const*, AVDictionaryEntry const*, int)'
/usr/bin/ld: CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o: in function `hw_create_device(AVHWDeviceType, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)':
cap_ffmpeg.cpp:(.text._ZL16hw_create_device14AVHWDeviceTypeiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb+0x15e): undefined reference to `av_hwdevice_get_type_name(AVHWDeviceType)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZL16hw_create_device14AVHWDeviceTypeiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb+0x718): undefined reference to `av_hwdevice_get_type_name(AVHWDeviceType)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZL16hw_create_device14AVHWDeviceTypeiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb+0x748): undefined reference to `av_hwdevice_ctx_create(AVBufferRef**, AVHWDeviceType, char const*, AVDictionary*, int)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZL16hw_create_device14AVHWDeviceTypeiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb+0x777): undefined reference to `av_hwdevice_get_type_name(AVHWDeviceType)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZL16hw_create_device14AVHWDeviceTypeiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb+0xe20): undefined reference to `av_buffer_unref(AVBufferRef**)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZL16hw_create_device14AVHWDeviceTypeiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb+0x144b): undefined reference to `av_hwdevice_get_type_name(AVHWDeviceType)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZL16hw_create_device14AVHWDeviceTypeiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb+0x146c): undefined reference to `av_buffer_ref(AVBufferRef*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZL16hw_create_device14AVHWDeviceTypeiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb+0x16d6): undefined reference to `av_buffer_unref(AVBufferRef**)'
/usr/bin/ld: CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o: in function `CvCapture_FFMPEG::open(char const*, cv::VideoCaptureParameters const&)':
cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG4openEPKcRKN2cv22VideoCaptureParametersE+0x8a): undefined reference to `av_log_set_level(int)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG4openEPKcRKN2cv22VideoCaptureParametersE+0x96): undefined reference to `av_log_set_callback(void (*)(void*, int, char const*, __va_list_tag*))'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG4openEPKcRKN2cv22VideoCaptureParametersE+0x458): undefined reference to `avformat_network_init()'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG4openEPKcRKN2cv22VideoCaptureParametersE+0x51f): undefined reference to `av_log_set_level(int)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG4openEPKcRKN2cv22VideoCaptureParametersE+0x74b): undefined reference to `avformat_alloc_context()'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG4openEPKcRKN2cv22VideoCaptureParametersE+0x79b): undefined reference to `av_dict_parse_string(AVDictionary**, char const*, char const*, char const*, int)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG4openEPKcRKN2cv22VideoCaptureParametersE+0x7b2): undefined reference to `av_dict_get(AVDictionary const*, char const*, AVDictionaryEntry const*, int)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG4openEPKcRKN2cv22VideoCaptureParametersE+0x7c3): undefined reference to `av_find_input_format(char const*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG4openEPKcRKN2cv22VideoCaptureParametersE+0x7d4): undefined reference to `avformat_open_input(AVFormatContext**, char const*, AVInputFormat*, AVDictionary**)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG4openEPKcRKN2cv22VideoCaptureParametersE+0x7e6): undefined reference to `avformat_find_stream_info(AVFormatContext*, AVDictionary**)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG4openEPKcRKN2cv22VideoCaptureParametersE+0x974): undefined reference to `av_strerror(int, char*, unsigned long)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG4openEPKcRKN2cv22VideoCaptureParametersE+0xbe4): undefined reference to `av_dict_set(AVDictionary**, char const*, char const*, int)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG4openEPKcRKN2cv22VideoCaptureParametersE+0x1714): undefined reference to `av_codec_is_decoder(AVCodec const*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG4openEPKcRKN2cv22VideoCaptureParametersE+0x1756): undefined reference to `avcodec_default_get_format(AVCodecContext*, AVPixelFormat const*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG4openEPKcRKN2cv22VideoCaptureParametersE+0x1773): undefined reference to `av_buffer_unref(AVBufferRef**)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG4openEPKcRKN2cv22VideoCaptureParametersE+0x17f7): undefined reference to `av_dict_get(AVDictionary const*, char const*, AVDictionaryEntry const*, int)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG4openEPKcRKN2cv22VideoCaptureParametersE+0x182f): undefined reference to `avcodec_open2(AVCodecContext*, AVCodec const*, AVDictionary**)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG4openEPKcRKN2cv22VideoCaptureParametersE+0x1e77): undefined reference to `av_hwdevice_find_type_by_name(char const*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG4openEPKcRKN2cv22VideoCaptureParametersE+0x1ea0): undefined reference to `av_dict_get(AVDictionary const*, char const*, AVDictionaryEntry const*, int)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG4openEPKcRKN2cv22VideoCaptureParametersE+0x20ec): undefined reference to `avcodec_find_decoder_by_name(char const*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG4openEPKcRKN2cv22VideoCaptureParametersE+0x2338): undefined reference to `avcodec_find_decoder(AVCodecID)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG4openEPKcRKN2cv22VideoCaptureParametersE+0x2a01): undefined reference to `av_frame_alloc()'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN16CvCapture_FFMPEG4openEPKcRKN2cv22VideoCaptureParametersE+0x2a59): undefined reference to `av_stream_get_side_data(AVStream const*, AVPacketSideDataType, int*)'
/usr/bin/ld: CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o: in function `CvVideoWriter_FFMPEG::open(char const*, int, double, int, int, cv::VideoWriterParameters const&)':
cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0xa2): undefined reference to `av_log_set_level(int)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0xae): undefined reference to `av_log_set_callback(void (*)(void*, int, char const*, __va_list_tag*))'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0x438): undefined reference to `avformat_network_init()'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0x5ce): undefined reference to `av_guess_format(char const*, char const*, char const*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0x603): undefined reference to `av_codec_get_id(AVCodecTag const* const*, unsigned int)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0x663): undefined reference to `avformat_alloc_context()'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0x6a0): undefined reference to `av_malloc(unsigned long)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0x71f): undefined reference to `av_log_set_level(int)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0x76b): undefined reference to `avformat_new_stream(AVFormatContext*, AVCodec const*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0x7b4): undefined reference to `av_dict_parse_string(AVDictionary**, char const*, char const*, char const*, int)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0xa3c): undefined reference to `av_hwdevice_find_type_by_name(char const*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0xa68): undefined reference to `av_buffer_unref(AVBufferRef**)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0xa81): undefined reference to `av_codec_is_encoder(AVCodec const*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0xb64): undefined reference to `avcodec_get_context_defaults3(AVCodecContext*, AVCodec const*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0xcda): undefined reference to `av_sub_q(AVRational, AVRational)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0xde5): undefined reference to `av_opt_set(void*, char const*, char const*, int)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0xe41): undefined reference to `av_buffer_ref(AVBufferRef*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0xee7): undefined reference to `avcodec_open2(AVCodecContext*, AVCodec const*, AVDictionary**)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0x1200): undefined reference to `av_buffer_unref(AVBufferRef**)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0x1216): undefined reference to `av_dict_free(AVDictionary**)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0x1248): undefined reference to `av_malloc(unsigned long)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0x1285): undefined reference to `av_frame_alloc()'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0x12ef): undefined reference to `avio_open(AVIOContext**, char const*, int)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0x1302): undefined reference to `avformat_write_header(AVFormatContext*, AVDictionary**)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0x1464): undefined reference to `avcodec_find_encoder(AVCodecID)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0x2121): undefined reference to `av_codec_get_tag(AVCodecTag const* const*, AVCodecID)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0x2208): undefined reference to `avformat_get_riff_video_tags()'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0x2214): undefined reference to `avformat_get_mov_video_tags()'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0x222a): undefined reference to `av_codec_get_id(AVCodecTag const* const*, unsigned int)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0x2282): undefined reference to `avcodec_descriptor_get_by_name(char const*)'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0x250f): undefined reference to `av_frame_alloc()'
/usr/bin/ld: cap_ffmpeg.cpp:(.text._ZN20CvVideoWriter_FFMPEG4openEPKcidiiRKN2cv21VideoWriterParametersE+0x254b): undefined reference to `av_free(void*)'
collect2: error: ld returned 1 exit status
gmake[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/build.make:267: lib/libopencv_videoio.so.4.6.0] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:6227: modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
gmake: *** [Makefile:166: all] Error 2
Full Output