Using opencv ffmpeg decodec video stream, meeting error: ‘AVBSFContext’ does not name a type; did you mean ‘AVIOContext’?

environment:
ubuntu version:Ubuntu 18.04.5 LTS bionic x86_64
opencv version : 4.5.3
opencv_contrib: 4.5.3
ffmpeg : N-103406-gdc34bf45c5
ffnvcodec : use nvidia sample
nvidia driver :470.57.02
cuda version :11.4
RTX3090
https://docs.nvidia.com/video-technologies/video-codec-sdk/ffmpeg-with-nvidia-gpu/
test ffmpeg and ffnvcodec : successfully

but I met a error when compiling opencv using cmake 3.10.2

compile opencv setting :-D WITH_CUDA=ON, -D WITH_NVCUVID=ON, -D WITH_FFMPEG=ON,

[ 34%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/shader/avg_pool_spv.cpp.o
In file included from /home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg.cpp:50:0:
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:537:5: error: ‘AVBSFContext’ does not name a type; did you mean ‘AVIOContext’?
AVBSFContext* bsfc;
^~~~~~~~~~~~
AVIOContext
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘void CvCapture_FFMPEG::init()’:
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:583:5: error: ‘bsfc’ was not declared in this scope
bsfc = NULL;
^~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:583:5: note: suggested alternative: ‘erfc’
bsfc = NULL;
^~~~
erfc
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘void CvCapture_FFMPEG::close()’:
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:613:34: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codec’
avcodec_close( video_st->codec );
^~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:648:9: error: ‘bsfc’ was not declared in this scope
if (bsfc)
^~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:648:9: note: suggested alternative: ‘erfc’
if (bsfc)
^~~~
erfc
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:651:9: error: ‘av_bsf_free’ was not declared in this scope
av_bsf_free(&bsfc);
^~~~~~~~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:651:9: note: suggested alternative: ‘av_opt_free’
av_bsf_free(&bsfc);
^~~~~~~~~~~
av_opt_free
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: At global scope:
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:796:39: error: ‘AVLockOp’ has not been declared
static int LockCallBack(void **mutex, AVLockOp op)
^~~~~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: In function ‘int LockCallBack(void**, int)’:
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:801:14: error: ‘AV_LOCK_CREATE’ was not declared in this scope
case AV_LOCK_CREATE:
^~~~~~~~~~~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:801:14: note: suggested alternative: ‘AV_LOG_TRACE’
case AV_LOCK_CREATE:
^~~~~~~~~~~~~~
AV_LOG_TRACE
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:810:14: error: ‘AV_LOCK_OBTAIN’ was not declared in this scope
case AV_LOCK_OBTAIN:
^~~~~~~~~~~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:810:14: note: suggested alternative: ‘CLOCK_TAI’
case AV_LOCK_OBTAIN:
^~~~~~~~~~~~~~
CLOCK_TAI
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:814:14: error: ‘AV_LOCK_RELEASE’ was not declared in this scope
case AV_LOCK_RELEASE:
^~~~~~~~~~~~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:814:14: note: suggested alternative: ‘AV_LOG_VERBOSE’
case AV_LOCK_RELEASE:
^~~~~~~~~~~~~~~
AV_LOG_VERBOSE
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:818:14: error: ‘AV_LOCK_DESTROY’ was not declared in this scope
case AV_LOCK_DESTROY:
^~~~~~~~~~~~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:818:14: note: suggested alternative: ‘AV_LOG_ERROR’
case AV_LOCK_DESTROY:
^~~~~~~~~~~~~~~
AV_LOG_ERROR
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: In constructor ‘InternalFFMpegRegister::InternalFFMpegRegister()’:
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:871:9: error: ‘av_register_all’ was not declared in this scope
av_register_all();
^~~~~~~~~~~~~~~
[ 34%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/shader/concat_spv.cpp.o
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:871:9: note: suggested alternative: ‘register_t’
av_register_all();
^~~~~~~~~~~~~~~
register_t
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:874:9: error: ‘av_lockmgr_register’ was not declared in this scope
av_lockmgr_register(&LockCallBack);
^~~~~~~~~~~~~~~~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: In destructor ‘InternalFFMpegRegister::~InternalFFMpegRegister()’:
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:878:9: error: ‘av_lockmgr_register’ was not declared in this scope
av_lockmgr_register(NULL);
^~~~~~~~~~~~~~~~~~~
In file included from /home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg.cpp:50:0:
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘bool CvCapture_FFMPEG::open(const char*, const cv::VideoCaptureParameters&)’:
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:986:42: error: invalid conversion from ‘const AVInputFormat*’ to ‘AVInputFormat*’ [-fpermissive]
input_format = av_find_input_format(entry->value);
^~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1005:47: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codec’
AVCodecContext* enc = ic->streams[i]->codec;
^

/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1091:53: error: invalid conversion from ‘const AVCodec*’ to ‘AVCodec*’ [-fpermissive]
codec = avcodec_find_decoder(enc->codec_id);
^
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1100:61: error: invalid conversion from ‘const AVCodec*’ to ‘AVCodec*’ [-fpermissive]
codec = avcodec_find_decoder_by_name(video_codec_param->value);
^~
[ 34%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/shader/conv48_spv.cpp.o
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘bool CvCapture_FFMPEG::processRawPacket()’:
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1220:19: error: ‘AVBitStreamFilter’ does not name a type
const AVBitStreamFilter * bsf = av_bsf_get_by_name(filterName);
^
~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1221:18: error: ‘bsf’ was not declared in this scope
if (!bsf)
^~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1226:36: error: ‘bsf’ was not declared in this scope
int err = av_bsf_alloc(bsf, &bsfc);
^~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1226:42: error: ‘bsfc’ was not declared in this scope
int err = av_bsf_alloc(bsf, &bsfc);
^~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1226:42: note: suggested alternative: ‘erfc’
int err = av_bsf_alloc(bsf, &bsfc);
^~~~
erfc
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1226:23: error: ‘av_bsf_alloc’ was not declared in this scope
int err = av_bsf_alloc(bsf, &bsfc);
^~~~~~~~~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1226:23: note: suggested alternative: ‘av_max_alloc’
int err = av_bsf_alloc(bsf, &bsfc);
^~~~~~~~~~~~
av_max_alloc
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1233:19: error: ‘av_bsf_init’ was not declared in this scope
err = av_bsf_init(bsfc);
^~~~~~~~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1233:19: note: suggested alternative: ‘av_uninit’
err = av_bsf_init(bsfc);
^~~~~~~~~~~
av_uninit
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1249:9: error: ‘bsfc’ was not declared in this scope
if (bsfc)
^~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1249:9: note: suggested alternative: ‘erfc’
if (bsfc)
^~~~
erfc
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1257:19: error: ‘av_bsf_send_packet’ was not declared in this scope
int err = av_bsf_send_packet(bsfc, &packet);
^~~~~~~~~~~~~~~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1257:19: note: suggested alternative: ‘avcodec_send_packet’
int err = av_bsf_send_packet(bsfc, &packet);
^~~~~~~~~~~~~~~~~~
avcodec_send_packet
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1263:15: error: ‘av_bsf_receive_packet’ was not declared in this scope
err = av_bsf_receive_packet(bsfc, &packet_filtered);
^~~~~~~~~~~~~~~~~~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1263:15: note: suggested alternative: ‘avcodec_receive_packet’
err = av_bsf_receive_packet(bsfc, &packet_filtered);
^~~~~~~~~~~~~~~~~~~~~
avcodec_receive_packet
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘bool CvCapture_FFMPEG::grabFrame()’:
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1307:45: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codec’
valid = avcodec_receive_frame(video_st->codec, picture) >= 0;
^~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1357:43: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codec’
if (avcodec_send_packet(video_st->codec, &packet) < 0) {
^~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1360:47: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codec’
ret = avcodec_receive_frame(video_st->codec, picture);
^~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1369:40: error: ‘AVFrame {aka struct AVFrame}’ has no member named ‘pkt_pts’; did you mean ‘pkt_dts’?
picture_pts = picture->pkt_pts != AV_NOPTS_VALUE_ && picture->pkt_pts != 0 ? picture->pkt_pts : picture->pkt_dts;
^~~~~~~
pkt_dts
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1369:79: error: ‘AVFrame {aka struct AVFrame}’ has no member named ‘pkt_pts’; did you mean ‘pkt_dts’?
picture_pts = picture->pkt_pts != AV_NOPTS_VALUE_ && picture->pkt_pts != 0 ? picture->pkt_pts : picture->pkt_dts;
^~~~~~~
pkt_dts
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1369:103: error: ‘AVFrame {aka struct AVFrame}’ has no member named ‘pkt_pts’; did you mean ‘pkt_dts’?
picture_pts = picture->pkt_pts != AV_NOPTS_VALUE_ && picture->pkt_pts != 0 ? picture->pkt_pts : picture->pkt_dts;
^~~~~~~
pkt_dts
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘bool CvCapture_FFMPEG::retrieveFrame(int, unsigned char**, int*, int*, int*, int*)’:
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1405:23: error: ‘bsfc’ was not declared in this scope
AVPacket& p = bsfc ? packet_filtered : packet;
^~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1405:23: note: suggested alternative: ‘erfc’
AVPacket& p = bsfc ? packet_filtered : packet;
^~~~
erfc
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1431:34: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codec’
frame.width != video_st->codec->width ||
^~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1432:35: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codec’
frame.height != video_st->codec->height ||
^~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1437:38: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codec’
int buffer_width = video_st->codec->coded_width, buffer_height = video_st->codec->coded_height;
^~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1441:31: error: ‘buffer_height’ was not declared in this scope
buffer_width, buffer_height,
^~~~~~~~~~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1441:31: note: suggested alternative: ‘buffer_width’
buffer_width, buffer_height,
^~~~~~~~~~~~~
buffer_width
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1471:33: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codec’
frame.width = video_st->codec->width;
^~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1472:34: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codec’
frame.height = video_st->codec->height;
^~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1482:26: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codec’
0, video_st->codec->coded_height,
^~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘bool CvCapture_FFMPEG::retrieveHWFrame(cv::OutputArray)’:
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1511:44: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codec’
return hw_copy_frame_to_umat(video_st->codec->hw_device_ctx, picture, output);
^~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘double CvCapture_FFMPEG::getProperty(int) const’:
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1547:30: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codec’
codec_id = video_st->codec->codec_id;
^~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1548:40: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codec’
codec_tag = (double) video_st->codec->codec_tag;
^~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1568:43: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codec’
AVPixelFormat pix_fmt = video_st->codec->pix_fmt;
^~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘double CvCapture_FFMPEG::get_fps() const’:
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1639:52: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codec’
fps = 1.0 / r2d(ic->streams[video_stream]->codec->time_base);
^~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘void CvCapture_FFMPEG::seek(int64_t)’:
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1696:58: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codec’
avcodec_flush_buffers(ic->streams[video_stream]->codec);
^~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: In function ‘bool icv_configure_video_stream_FFMPEG(AVFormatContext*, AVStream*, const AVCodec*, int, int, int, double, AVPixelFormat)’:
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1931:29: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codec’
AVCodecContext c = st->codec;
^~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1939:5: error: ‘avcodec_get_context_defaults3’ was not declared in this scope
avcodec_get_context_defaults3(c, codec);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 34%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/shader/conv_spv.cpp.o
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1939:5: note: suggested alternative: ‘avcodec_get_frame_class’
avcodec_get_context_defaults3(c, codec);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
avcodec_get_frame_class
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: In function ‘int icv_av_write_frame_FFMPEG(AVFormatContext
, AVStream*, uint8_t*, uint32_t, AVFrame*, int)’:
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:2046:35: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codec’
AVCodecContext* c = video_st->codec;
^~~~~
[ 34%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/vkcom/shader/dw_conv_spv.cpp.o
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘bool CvVideoWriter_FFMPEG::writeFrame(const unsigned char*, int, int, int, int, int)’:
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:2145:35: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codec’
AVCodecContext* c = video_st->codec;
^~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:2223:19: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codec’
if (video_st->codec->hw_device_ctx) {
^~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:2230:45: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codec’
if (av_hwframe_get_buffer(video_st->codec->hw_frames_ctx, hw_frame, 0) < 0) {
^~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘bool CvVideoWriter_FFMPEG::writeHWFrame(cv::InputArray)’:
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:2259:20: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codec’
if (!video_st->codec->hw_frames_ctx)
^~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:2267:41: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codec’
if (av_hwframe_get_buffer(video_st->codec->hw_frames_ctx, hw_frame, 0) < 0) {
^~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:2273:42: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codec’
if (!hw_copy_umat_to_frame(video_st->codec->hw_device_ctx, input, hw_frame)) {
^~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘void CvVideoWriter_FFMPEG::close()’:
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:2348:19: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codec’
if( video_st->codec->pix_fmt != input_pix_fmt)
^~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:2360:29: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codec’
avcodec_close(video_st->codec);
^~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘bool CvVideoWriter_FFMPEG::open(const char*, int, double, int, int, const cv::VideoWriterParameters&)’:
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:2487:26: error: invalid conversion from ‘const AVOutputFormat*’ to ‘AVOutputFormat*’ [-fpermissiv]
fmt = av_guess_format(NULL, filename, NULL);
~^~~~~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:2567:18: error: ‘AVFormatContext {aka struct AVFormatContext}’ has no member named ‘filename’
snprintf(oc->filename, sizeof(oc->filename), “%s”, filename);
^~~~~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:2567:39: error: ‘AVFormatContext {aka struct AVFormatContext}’ has no member named ‘filename’
snprintf(oc->filename, sizeof(oc->filename), “%s”, filename);
^~~~~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:2683:58: error: ‘AVFormatContext {aka struct AVFormatContext}’ has no member named ‘filename’
codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, AVMEDIA_TYPE_VIDEO);
^~~~~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:2701:35: error: ‘AVStream {aka struct AVStream}’ has no member named ‘codec’
AVCodecContext c = video_st->codec;
^~~~~
/home/wdf/workspace/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:2734:41: error: invalid conversion from ‘const AVCodec
’ to ‘AVCodec*’ [-fpermissive]
codec = avcodec_find_encoder(codec_id);
~~~~~~~~~~~~^~
/home/wdf/workspace/opencv/opencv_contrib/modules/cudawarping/src/cuda/resize.cu(155): warning: function “tex2D(texture<T, 2, cudaReadModeElementType>, float, float) [with T=uchar]”

I think this error may have not found ffmpeg include files , but i check ffmpeg include files install path : /usr/local/include
how to sovle it ,can you help me?

my nvidia RTX3090