Bug 2058684 - Build OpenCV with ffmpeg-free support?
Summary: Build OpenCV with ffmpeg-free support?
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: opencv
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nicolas Chauvet (kwizart)
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-02-25 15:43 UTC by Ben Beasley
Modified: 2022-03-03 16:30 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-02-25 16:41:07 UTC
Type: Bug


Attachments (Terms of Use)

Description Ben Beasley 2022-02-25 15:43:53 UTC
Description of problem:

I have a package (https://src.fedoraproject.org/rpms/fasttrack), which in its latest upstream version strongly favors the FFMPEG backend for OpenCV.

Now that a stripped-down/legally unencumbered version of FFMPEG is packaged as ffmpeg-free (https://src.fedoraproject.org/rpms/ffmpeg), is there any reason not to build OpenCV with FFMPEG support in Fedora?

Version-Release number of selected component (if applicable): 4.5.5-5

Comment 1 Ben Beasley 2022-02-25 15:44:12 UTC
I tried doing a test build and encountered a few issues, but I wanted to wait for input on the basic idea before investing effort in trying to solve them.


In file included from /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg.cpp:50:
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:542:5: error: 'AVBSFContext' does not name a type; did you mean 'AVIOContext'?
  542 |     AVBSFContext* bsfc;
      |     ^~~~~~~~~~~~
      |     AVIOContext
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function 'void CvCapture_FFMPEG::init()':
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:589:5: error: 'bsfc' was not declared in this scope
  589 |     bsfc = NULL;
      |     ^~~~
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function 'void CvCapture_FFMPEG::close()':
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:620:34: error: 'AVStream' {aka 'struct AVStream'} has no member named 'codec'
  620 |         avcodec_close( video_st->codec );
      |                                  ^~~~~
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:655:9: error: 'bsfc' was not declared in this scope
  655 |     if (bsfc)
      |         ^~~~
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:658:9: error: 'av_bsf_free' was not declared in this scope; did you mean 'av_opt_free'?
  658 |         av_bsf_free(&bsfc);
      |         ^~~~~~~~~~~
      |         av_opt_free
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp: At global scope:
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:803:39: error: 'AVLockOp' has not been declared
  803 | static int LockCallBack(void **mutex, AVLockOp op)
      |                                       ^~~~~~~~
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp: In function 'int LockCallBack(void**, int)':
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:808:14: error: 'AV_LOCK_CREATE' was not declared in this scope; did you mean 'AV_LOG_TRACE'?
  808 |         case AV_LOCK_CREATE:
      |              ^~~~~~~~~~~~~~
      |              AV_LOG_TRACE
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:817:14: error: 'AV_LOCK_OBTAIN' was not declared in this scope
  817 |         case AV_LOCK_OBTAIN:
      |              ^~~~~~~~~~~~~~
cd /builddir/build/BUILD/opencv-4.5.5/redhat-linux-build/modules/features2d && /usr/bin/cmake -E cmake_symlink_library ../../lib/libopencv_features2d.so.4.5.5 ../../lib/libopencv_features2d.so.4.5 ../../lib/libopencv_features2d.so
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:821:14: error: 'AV_LOCK_RELEASE' was not declared in this scope
  821 |         case AV_LOCK_RELEASE:
      |              ^~~~~~~~~~~~~~~
[ 15%] Building CXX object modules/xphoto/CMakeFiles/opencv_xphoto.dir/src/simple_color_balance.cpp.o
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:825:14: error: 'AV_LOCK_DESTROY' was not declared in this scope
  825 |         case AV_LOCK_DESTROY:
      |              ^~~~~~~~~~~~~~~



/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp: In constructor 'InternalFFMpegRegister::InternalFFMpegRegister()':
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:885:9: error: 'av_register_all' was not declared in this scope
  885 |         av_register_all();
      |         ^~~~~~~~~~~~~~~



/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:888:9: error: 'av_lockmgr_register' was not declared in this scope
  888 |         av_lockmgr_register(&LockCallBack);
      |         ^~~~~~~~~~~~~~~~~~~



/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function 'bool CvCapture_FFMPEG::open(const char*, const cv::VideoCaptureParameters&)':
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1000:42: error: invalid conversion from 'const AVInputFormat*' to 'AVInputFormat*' [-fpermissive]
 1000 |       input_format = av_find_input_format(entry->value);
      |                      ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
      |                                          |
      |                                          const AVInputFormat*
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1019:47: error: 'AVStream' {aka 'struct AVStream'} has no member named 'codec'
 1019 |         AVCodecContext* enc = ic->streams[i]->codec;
      |                                               ^~~~~



/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1105:53: error: invalid conversion from 'const AVCodec*' to 'AVCodec*' [-fpermissive]
 1105 |                         codec = avcodec_find_decoder(enc->codec_id);
      |                                 ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
      |                                                     |
      |                                                     const AVCodec*
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1114:61: error: invalid conversion from 'const AVCodec*' to 'AVCodec*' [-fpermissive]
 1114 |                         codec = avcodec_find_decoder_by_name(video_codec_param->value);
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                             |
      |                                                             const AVCodec*
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function 'bool CvCapture_FFMPEG::processRawPacket()':
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1234:19: error: 'AVBitStreamFilter' does not name a type
 1234 |             const AVBitStreamFilter * bsf = av_bsf_get_by_name(filterName);
      |                   ^~~~~~~~~~~~~~~~~
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1235:18: error: 'bsf' was not declared in this scope
 1235 |             if (!bsf)
      |                  ^~~
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1240:36: error: 'bsf' was not declared in this scope
 1240 |             int err = av_bsf_alloc(bsf, &bsfc);
      |                                    ^~~
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1240:42: error: 'bsfc' was not declared in this scope
 1240 |             int err = av_bsf_alloc(bsf, &bsfc);
      |                                          ^~~~
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1240:23: error: 'av_bsf_alloc' was not declared in this scope; did you mean 'av_max_alloc'?
 1240 |             int err = av_bsf_alloc(bsf, &bsfc);
      |                       ^~~~~~~~~~~~
      |                       av_max_alloc
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1247:19: error: 'av_bsf_init' was not declared in this scope; did you mean 'av_uninit'?
 1247 |             err = av_bsf_init(bsfc);
      |                   ^~~~~~~~~~~
      |                   av_uninit
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1263:9: error: 'bsfc' was not declared in this scope
 1263 |     if (bsfc)
      |         ^~~~
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1271:19: error: 'av_bsf_send_packet' was not declared in this scope; did you mean 'avcodec_send_packet'?
 1271 |         int err = av_bsf_send_packet(bsfc, &packet);
      |                   ^~~~~~~~~~~~~~~~~~
      |                   avcodec_send_packet
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1277:15: error: 'av_bsf_receive_packet' was not declared in this scope; did you mean 'avcodec_receive_packet'?
 1277 |         err = av_bsf_receive_packet(bsfc, &packet_filtered);
      |               ^~~~~~~~~~~~~~~~~~~~~
      |               avcodec_receive_packet
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function 'bool CvCapture_FFMPEG::grabFrame()':
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1321:45: error: 'AVStream' {aka 'struct AVStream'} has no member named 'codec'
 1321 |     valid = avcodec_receive_frame(video_st->codec, picture) >= 0;
      |                                             ^~~~~
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1371:43: error: 'AVStream' {aka 'struct AVStream'} has no member named 'codec'
 1371 |         if (avcodec_send_packet(video_st->codec, &packet) < 0) {
      |                                           ^~~~~
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1374:47: error: 'AVStream' {aka 'struct AVStream'} has no member named 'codec'
 1374 |         ret = avcodec_receive_frame(video_st->codec, picture);
      |                                               ^~~~~
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1383:40: error: 'AVFrame' {aka 'struct AVFrame'} has no member named 'pkt_pts'; did you mean 'pkt_dts'?
 1383 |                 picture_pts = picture->pkt_pts != AV_NOPTS_VALUE_ && picture->pkt_pts != 0 ? picture->pkt_pts : picture->pkt_dts;
      |                                        ^~~~~~~
      |                                        pkt_dts
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1383:79: error: 'AVFrame' {aka 'struct AVFrame'} has no member named 'pkt_pts'; did you mean 'pkt_dts'?
 1383 |                 picture_pts = picture->pkt_pts != AV_NOPTS_VALUE_ && picture->pkt_pts != 0 ? picture->pkt_pts : picture->pkt_dts;
      |                                                                               ^~~~~~~
      |                                                                               pkt_dts
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1383:103: error: 'AVFrame' {aka 'struct AVFrame'} has no member named 'pkt_pts'; did you mean 'pkt_dts'?
 1383 |                 picture_pts = picture->pkt_pts != AV_NOPTS_VALUE_ && picture->pkt_pts != 0 ? picture->pkt_pts : picture->pkt_dts;
      |                                                                                                       ^~~~~~~
      |                                                                                                       pkt_dts
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function 'bool CvCapture_FFMPEG::retrieveFrame(int, unsigned char**, int*, int*, int*, int*)':
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1421:27: error: 'bsfc' was not declared in this scope
 1421 |             AVPacket& p = bsfc ? packet_filtered : packet;
      |                           ^~~~
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1427:48: error: 'AVStream' {aka 'struct AVStream'} has no member named 'codec'
 1427 |             *data = ic->streams[video_stream]->codec->extradata;
      |                                                ^~~~~
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1428:48: error: 'AVStream' {aka 'struct AVStream'} has no member named 'codec'
 1428 |             *step = ic->streams[video_stream]->codec->extradata_size;
      |                                                ^~~~~
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1453:34: error: 'AVStream' {aka 'struct AVStream'} has no member named 'codec'
 1453 |         frame.width != video_st->codec->width ||
      |                                  ^~~~~
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1454:35: error: 'AVStream' {aka 'struct AVStream'} has no member named 'codec'
 1454 |         frame.height != video_st->codec->height ||
      |                                   ^~~~~
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1459:38: error: 'AVStream' {aka 'struct AVStream'} has no member named 'codec'
 1459 |         int buffer_width = video_st->codec->coded_width, buffer_height = video_st->codec->coded_height;
      |                                      ^~~~~
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1463:31: error: 'buffer_height' was not declared in this scope; did you mean 'buffer_width'?
 1463 |                 buffer_width, buffer_height,
      |                               ^~~~~~~~~~~~~
      |                               buffer_width
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1493:33: error: 'AVStream' {aka 'struct AVStream'} has no member named 'codec'
 1493 |         frame.width = video_st->codec->width;
      |                                 ^~~~~
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1494:34: error: 'AVStream' {aka 'struct AVStream'} has no member named 'codec'
 1494 |         frame.height = video_st->codec->height;
      |                                  ^~~~~
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1504:26: error: 'AVStream' {aka 'struct AVStream'} has no member named 'codec'
 1504 |             0, video_st->codec->coded_height,
      |                          ^~~~~
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function 'bool CvCapture_FFMPEG::retrieveHWFrame(cv::OutputArray)':
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1533:44: error: 'AVStream' {aka 'struct AVStream'} has no member named 'codec'
 1533 |     return hw_copy_frame_to_umat(video_st->codec->hw_device_ctx, picture, output);
      |                                            ^~~~~
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function 'double CvCapture_FFMPEG::getProperty(int) const':
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1569:30: error: 'AVStream' {aka 'struct AVStream'} has no member named 'codec'
 1569 |         codec_id = video_st->codec->codec_id;
      |                              ^~~~~
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1570:40: error: 'AVStream' {aka 'struct AVStream'} has no member named 'codec'
 1570 |         codec_tag = (double) video_st->codec->codec_tag;
      |                                        ^~~~~
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1590:43: error: 'AVStream' {aka 'struct AVStream'} has no member named 'codec'
 1590 |         AVPixelFormat pix_fmt = video_st->codec->pix_fmt;
      |                                           ^~~~~
[ 15%] Building CXX object modules/line_descriptor/CMakeFiles/opencv_line_descriptor.dir/src/binary_descriptor.cpp.o
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1599:29: error: 'bsfc' was not declared in this scope
 1599 |         const AVPacket& p = bsfc ? packet_filtered : packet;
      |                             ^~~~
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function 'double CvCapture_FFMPEG::get_fps() const':
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1670:52: error: 'AVStream' {aka 'struct AVStream'} has no member named 'codec'
 1670 |         fps = 1.0 / r2d(ic->streams[video_stream]->codec->time_base);
      |                                                    ^~~~~
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function 'void CvCapture_FFMPEG::seek(int64_t)':
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1727:58: error: 'AVStream' {aka 'struct AVStream'} has no member named 'codec'
 1727 |         avcodec_flush_buffers(ic->streams[video_stream]->codec);
      |                                                          ^~~~~
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp: In function 'bool icv_configure_video_stream_FFMPEG(AVFormatContext*, AVStream*, const AVCodec*, int, int, int, double, AVPixelFormat)':
/builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:1962:29: error: 'AVStream' {aka 'struct AVStream'} has no member named 'codec'
 1962 |     AVCodecContext *c = st->codec;
      |                             ^~~~~



(and a few more)

Comment 2 Nicolas Chauvet (kwizart) 2022-02-25 16:14:17 UTC
I'm personally not supportive about ffmpeg-free in fedora at all.

I might revisit this later if ever this is a "glitch free" experience.


For now I recommend to keep using the gstreamer backend.

Comment 3 Ben Beasley 2022-02-25 16:18:52 UTC
Thanks for your feedback! Shall I leave this open, or close as WONTFIX?

Comment 4 Nicolas Chauvet (kwizart) 2022-02-25 16:24:38 UTC
You can close at WONTFIX.

At least, if you want to have a copr testing ffmpeg-free, feel free. The major issue is to see how it goes when some expected codecs aren't available. This requires a heavy testing. (and even to maintain test load for any future releases).

Comment 5 Sergio Basto 2022-03-03 16:30:35 UTC
(In reply to Ben Beasley from comment #1)
> I tried doing a test build and encountered a few issues, but I wanted to
> wait for input on the basic idea before investing effort in trying to solve
> them.
> 
> 
> In file included from
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg.cpp:50:
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 542:5: error: 'AVBSFContext' does not name a type; did you mean
> 'AVIOContext'?
>   542 |     AVBSFContext* bsfc;
>       |     ^~~~~~~~~~~~
>       |     AVIOContext
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> In member function 'void CvCapture_FFMPEG::init()':
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 589:5: error: 'bsfc' was not declared in this scope
>   589 |     bsfc = NULL;
>       |     ^~~~
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> In member function 'void CvCapture_FFMPEG::close()':
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 620:34: error: 'AVStream' {aka 'struct AVStream'} has no member named 'codec'
>   620 |         avcodec_close( video_st->codec );
>       |                                  ^~~~~
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 655:9: error: 'bsfc' was not declared in this scope
>   655 |     if (bsfc)
>       |         ^~~~
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 658:9: error: 'av_bsf_free' was not declared in this scope; did you mean
> 'av_opt_free'?
>   658 |         av_bsf_free(&bsfc);
>       |         ^~~~~~~~~~~
>       |         av_opt_free
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> At global scope:
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 803:39: error: 'AVLockOp' has not been declared
>   803 | static int LockCallBack(void **mutex, AVLockOp op)
>       |                                       ^~~~~~~~
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> In function 'int LockCallBack(void**, int)':
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 808:14: error: 'AV_LOCK_CREATE' was not declared in this scope; did you mean
> 'AV_LOG_TRACE'?
>   808 |         case AV_LOCK_CREATE:
>       |              ^~~~~~~~~~~~~~
>       |              AV_LOG_TRACE
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 817:14: error: 'AV_LOCK_OBTAIN' was not declared in this scope
>   817 |         case AV_LOCK_OBTAIN:
>       |              ^~~~~~~~~~~~~~
> cd /builddir/build/BUILD/opencv-4.5.5/redhat-linux-build/modules/features2d
> && /usr/bin/cmake -E cmake_symlink_library
> ../../lib/libopencv_features2d.so.4.5.5
> ../../lib/libopencv_features2d.so.4.5 ../../lib/libopencv_features2d.so
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 821:14: error: 'AV_LOCK_RELEASE' was not declared in this scope
>   821 |         case AV_LOCK_RELEASE:
>       |              ^~~~~~~~~~~~~~~
> [ 15%] Building CXX object
> modules/xphoto/CMakeFiles/opencv_xphoto.dir/src/simple_color_balance.cpp.o
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 825:14: error: 'AV_LOCK_DESTROY' was not declared in this scope
>   825 |         case AV_LOCK_DESTROY:
>       |              ^~~~~~~~~~~~~~~
> 
> 
> 
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> In constructor 'InternalFFMpegRegister::InternalFFMpegRegister()':
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 885:9: error: 'av_register_all' was not declared in this scope
>   885 |         av_register_all();
>       |         ^~~~~~~~~~~~~~~
> 
> 
> 
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 888:9: error: 'av_lockmgr_register' was not declared in this scope
>   888 |         av_lockmgr_register(&LockCallBack);
>       |         ^~~~~~~~~~~~~~~~~~~
> 
> 
> 
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> In member function 'bool CvCapture_FFMPEG::open(const char*, const
> cv::VideoCaptureParameters&)':
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1000:42: error: invalid conversion from 'const AVInputFormat*' to
> 'AVInputFormat*' [-fpermissive]
>  1000 |       input_format = av_find_input_format(entry->value);
>       |                      ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
>       |                                          |
>       |                                          const AVInputFormat*
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1019:47: error: 'AVStream' {aka 'struct AVStream'} has no member named
> 'codec'
>  1019 |         AVCodecContext* enc = ic->streams[i]->codec;
>       |                                               ^~~~~
> 
> 
> 
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1105:53: error: invalid conversion from 'const AVCodec*' to 'AVCodec*'
> [-fpermissive]
>  1105 |                         codec = avcodec_find_decoder(enc->codec_id);
>       |                                 ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
>       |                                                     |
>       |                                                     const AVCodec*
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1114:61: error: invalid conversion from 'const AVCodec*' to 'AVCodec*'
> [-fpermissive]
>  1114 |                         codec =
> avcodec_find_decoder_by_name(video_codec_param->value);
>       |                                
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
>       |                                                             |
>       |                                                             const
> AVCodec*
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> In member function 'bool CvCapture_FFMPEG::processRawPacket()':
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1234:19: error: 'AVBitStreamFilter' does not name a type
>  1234 |             const AVBitStreamFilter * bsf =
> av_bsf_get_by_name(filterName);
>       |                   ^~~~~~~~~~~~~~~~~
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1235:18: error: 'bsf' was not declared in this scope
>  1235 |             if (!bsf)
>       |                  ^~~
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1240:36: error: 'bsf' was not declared in this scope
>  1240 |             int err = av_bsf_alloc(bsf, &bsfc);
>       |                                    ^~~
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1240:42: error: 'bsfc' was not declared in this scope
>  1240 |             int err = av_bsf_alloc(bsf, &bsfc);
>       |                                          ^~~~
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1240:23: error: 'av_bsf_alloc' was not declared in this scope; did you mean
> 'av_max_alloc'?
>  1240 |             int err = av_bsf_alloc(bsf, &bsfc);
>       |                       ^~~~~~~~~~~~
>       |                       av_max_alloc
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1247:19: error: 'av_bsf_init' was not declared in this scope; did you mean
> 'av_uninit'?
>  1247 |             err = av_bsf_init(bsfc);
>       |                   ^~~~~~~~~~~
>       |                   av_uninit
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1263:9: error: 'bsfc' was not declared in this scope
>  1263 |     if (bsfc)
>       |         ^~~~
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1271:19: error: 'av_bsf_send_packet' was not declared in this scope; did you
> mean 'avcodec_send_packet'?
>  1271 |         int err = av_bsf_send_packet(bsfc, &packet);
>       |                   ^~~~~~~~~~~~~~~~~~
>       |                   avcodec_send_packet
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1277:15: error: 'av_bsf_receive_packet' was not declared in this scope; did
> you mean 'avcodec_receive_packet'?
>  1277 |         err = av_bsf_receive_packet(bsfc, &packet_filtered);
>       |               ^~~~~~~~~~~~~~~~~~~~~
>       |               avcodec_receive_packet
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> In member function 'bool CvCapture_FFMPEG::grabFrame()':
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1321:45: error: 'AVStream' {aka 'struct AVStream'} has no member named
> 'codec'
>  1321 |     valid = avcodec_receive_frame(video_st->codec, picture) >= 0;
>       |                                             ^~~~~
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1371:43: error: 'AVStream' {aka 'struct AVStream'} has no member named
> 'codec'
>  1371 |         if (avcodec_send_packet(video_st->codec, &packet) < 0) {
>       |                                           ^~~~~
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1374:47: error: 'AVStream' {aka 'struct AVStream'} has no member named
> 'codec'
>  1374 |         ret = avcodec_receive_frame(video_st->codec, picture);
>       |                                               ^~~~~
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1383:40: error: 'AVFrame' {aka 'struct AVFrame'} has no member named
> 'pkt_pts'; did you mean 'pkt_dts'?
>  1383 |                 picture_pts = picture->pkt_pts != AV_NOPTS_VALUE_ &&
> picture->pkt_pts != 0 ? picture->pkt_pts : picture->pkt_dts;
>       |                                        ^~~~~~~
>       |                                        pkt_dts
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1383:79: error: 'AVFrame' {aka 'struct AVFrame'} has no member named
> 'pkt_pts'; did you mean 'pkt_dts'?
>  1383 |                 picture_pts = picture->pkt_pts != AV_NOPTS_VALUE_ &&
> picture->pkt_pts != 0 ? picture->pkt_pts : picture->pkt_dts;
>       |                                                                     
> ^~~~~~~
>       |                                                                     
> pkt_dts
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1383:103: error: 'AVFrame' {aka 'struct AVFrame'} has no member named
> 'pkt_pts'; did you mean 'pkt_dts'?
>  1383 |                 picture_pts = picture->pkt_pts != AV_NOPTS_VALUE_ &&
> picture->pkt_pts != 0 ? picture->pkt_pts : picture->pkt_dts;
>       |                                                                     
> ^~~~~~~
>       |                                                                     
> pkt_dts
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> In member function 'bool CvCapture_FFMPEG::retrieveFrame(int, unsigned
> char**, int*, int*, int*, int*)':
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1421:27: error: 'bsfc' was not declared in this scope
>  1421 |             AVPacket& p = bsfc ? packet_filtered : packet;
>       |                           ^~~~
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1427:48: error: 'AVStream' {aka 'struct AVStream'} has no member named
> 'codec'
>  1427 |             *data = ic->streams[video_stream]->codec->extradata;
>       |                                                ^~~~~
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1428:48: error: 'AVStream' {aka 'struct AVStream'} has no member named
> 'codec'
>  1428 |             *step = ic->streams[video_stream]->codec->extradata_size;
>       |                                                ^~~~~
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1453:34: error: 'AVStream' {aka 'struct AVStream'} has no member named
> 'codec'
>  1453 |         frame.width != video_st->codec->width ||
>       |                                  ^~~~~
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1454:35: error: 'AVStream' {aka 'struct AVStream'} has no member named
> 'codec'
>  1454 |         frame.height != video_st->codec->height ||
>       |                                   ^~~~~
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1459:38: error: 'AVStream' {aka 'struct AVStream'} has no member named
> 'codec'
>  1459 |         int buffer_width = video_st->codec->coded_width,
> buffer_height = video_st->codec->coded_height;
>       |                                      ^~~~~
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1463:31: error: 'buffer_height' was not declared in this scope; did you mean
> 'buffer_width'?
>  1463 |                 buffer_width, buffer_height,
>       |                               ^~~~~~~~~~~~~
>       |                               buffer_width
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1493:33: error: 'AVStream' {aka 'struct AVStream'} has no member named
> 'codec'
>  1493 |         frame.width = video_st->codec->width;
>       |                                 ^~~~~
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1494:34: error: 'AVStream' {aka 'struct AVStream'} has no member named
> 'codec'
>  1494 |         frame.height = video_st->codec->height;
>       |                                  ^~~~~
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1504:26: error: 'AVStream' {aka 'struct AVStream'} has no member named
> 'codec'
>  1504 |             0, video_st->codec->coded_height,
>       |                          ^~~~~
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> In member function 'bool CvCapture_FFMPEG::retrieveHWFrame(cv::OutputArray)':
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1533:44: error: 'AVStream' {aka 'struct AVStream'} has no member named
> 'codec'
>  1533 |     return hw_copy_frame_to_umat(video_st->codec->hw_device_ctx,
> picture, output);
>       |                                            ^~~~~
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> In member function 'double CvCapture_FFMPEG::getProperty(int) const':
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1569:30: error: 'AVStream' {aka 'struct AVStream'} has no member named
> 'codec'
>  1569 |         codec_id = video_st->codec->codec_id;
>       |                              ^~~~~
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1570:40: error: 'AVStream' {aka 'struct AVStream'} has no member named
> 'codec'
>  1570 |         codec_tag = (double) video_st->codec->codec_tag;
>       |                                        ^~~~~
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1590:43: error: 'AVStream' {aka 'struct AVStream'} has no member named
> 'codec'
>  1590 |         AVPixelFormat pix_fmt = video_st->codec->pix_fmt;
>       |                                           ^~~~~
> [ 15%] Building CXX object
> modules/line_descriptor/CMakeFiles/opencv_line_descriptor.dir/src/
> binary_descriptor.cpp.o
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1599:29: error: 'bsfc' was not declared in this scope
>  1599 |         const AVPacket& p = bsfc ? packet_filtered : packet;
>       |                             ^~~~
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> In member function 'double CvCapture_FFMPEG::get_fps() const':
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1670:52: error: 'AVStream' {aka 'struct AVStream'} has no member named
> 'codec'
>  1670 |         fps = 1.0 / r2d(ic->streams[video_stream]->codec->time_base);
>       |                                                    ^~~~~
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> In member function 'void CvCapture_FFMPEG::seek(int64_t)':
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1727:58: error: 'AVStream' {aka 'struct AVStream'} has no member named
> 'codec'
>  1727 |         avcodec_flush_buffers(ic->streams[video_stream]->codec);
>       |                                                          ^~~~~
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> In function 'bool icv_configure_video_stream_FFMPEG(AVFormatContext*,
> AVStream*, const AVCodec*, int, int, int, double, AVPixelFormat)':
> /builddir/build/BUILD/opencv-4.5.5/modules/videoio/src/cap_ffmpeg_impl.hpp:
> 1962:29: error: 'AVStream' {aka 'struct AVStream'} has no member named
> 'codec'
>  1962 |     AVCodecContext *c = st->codec;
>       |                             ^~~~~
> 
> 
> 
> (and a few more)


This is the tipical errors of FFmpeg 5 , upstream need to fix it and support FFmpeg 5


Note You need to log in before you can comment on or make changes to this bug.