opencv / opencv/opencv-python

Please make opencv-python-headless support FFmpeg 9.0

Open
#1,258 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
5.4k
Forks
1k
Avg merge
22h 17m
Merged PRs (30d)
3

Description

Errors:

[ 80%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o
In file included from /wrkdirs/usr/ports/graphics/py-opencv-python-headless/work-py312/opencv-python-92/opencv/modules/videoio/src/cap_ffmpeg.cpp:50:
In file included from /wrkdirs/usr/ports/graphics/py-opencv-python-headless/work-py312/opencv-python-92/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:175:
/wrkdirs/usr/ports/graphics/py-opencv-python-headless/work-py312/opencv-python-92/opencv/modules/videoio/src/cap_ffmpeg_hw.hpp:760:82: error: no member named 'pix_fmts' in 'AVCodec'
  760 |             if (av_codec_is_encoder(c) && hw_native_fmt != AV_PIX_FMT_NONE && c->pix_fmts) {
      |                                                                               ~  ^
/wrkdirs/usr/ports/graphics/py-opencv-python-headless/work-py312/opencv-python-92/opencv/modules/videoio/src/cap_ffmpeg_hw.hpp:761:36: error: no member named 'pix_fmts' in 'AVCodec'
  761 |                 for (int i = 0; c->pix_fmts[i] != AV_PIX_FMT_NONE; i++) {
      |                                 ~  ^
/wrkdirs/usr/ports/graphics/py-opencv-python-headless/work-py312/opencv-python-92/opencv/modules/videoio/src/cap_ffmpeg_hw.hpp:762:28: error: no member named 'pix_fmts' in 'AVCodec'
  762 |                     if (c->pix_fmts[i] == hw_native_fmt) {
      |                         ~  ^
In file included from /wrkdirs/usr/ports/graphics/py-opencv-python-headless/work-py312/opencv-python-92/opencv/modules/videoio/src/cap_ffmpeg.cpp:50:
/wrkdirs/usr/ports/graphics/py-opencv-python-headless/work-py312/opencv-python-92/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:2586:24: error: no member named 'supported_framerates' in 'AVCodec'
 2586 |     if(codec && codec->supported_framerates){
      |                 ~~~~~  ^
/wrkdirs/usr/ports/graphics/py-opencv-python-headless/work-py312/opencv-python-92/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:2587:37: error: no member named 'supported_framerates' in 'AVCodec'
 2587 |         const AVRational *p= codec->supported_framerates;
      |                              ~~~~~  ^
5 errors generated.
*** Error code 1

Downstream bug report: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297370

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting opencv/modules/videoio/src/cap_ffmpeg_hw.hpp around line 760 and cap_ffmpeg_impl.hpp around line 2586, then reproduce the headless build against FFmpeg 9.0. Check the relevant FFmpeg API changes and verify that the build completes without the reported AVCodec member errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
audio-video-rtc, build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.