Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 834422

Summary: sci-libs/opencascade-7.6.0-r2 with ffmpeg-5.0: src/Media/Media_FormatContext.cxx:413:25: error: ‘const AVStream’ {aka ‘const struct AVStream’} has no member named ‘codec’
Product: Gentoo Linux Reporter: Kobboi <gentoo>
Component: Current packagesAssignee: Bernd <waebbl-gentoo>
Status: RESOLVED FIXED    
Severity: normal CC: andrewammerlaan, atoth, matthias.nagel, proxy-maint
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://dev.opencascade.org/content/build-error-when-compiling-against-ffmpeg-5
See Also: https://github.com/gentoo/gentoo/pull/24525
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 831437    
Attachments: build.log.gz
emerge-info.txt

Description Kobboi 2022-02-28 21:38:07 UTC
[2287/5853] /usr/bin/x86_64-pc-linux-gnu-g++ -DHAVE_FFMPEG -DHAVE_FREETYPE -DHAVE_GLES2_EXT -DHAVE_OPENGL_EXT -DHAVE_TK -DHAVE_XLIB -DOCC_CONVERT_SIGNALS -DTKService_EXPORTS -I/usr/include/freetype2 -I/var/tmp/portage/sci-libs/opencascade-7.6.0-r2/work/occt-V7_6_0_build/include/opencascade  -std=c++0x -O2 -march=znver3 -pipe -g -ggdb3 -fexceptio
ns -fPIC -Wall -Wextra -fPIC -MD -MT src/TKService/CMakeFiles/TKService.dir/__/Media/Media_FormatContext.cxx.o -MF src/TKService/CMakeFiles/TKService.dir/__/Media/Media_FormatContext.cxx.o.d -o src/TKService/CMakeFiles/TKService.dir/__/Media/Media_FormatContext.cxx.o -c /var/tmp/portage/sci-libs/opencascade-7.6.0-r2/work/occt-V7_6_0/src/Media/Me
dia_FormatContext.cxx
FAILED: src/TKService/CMakeFiles/TKService.dir/__/Media/Media_FormatContext.cxx.o 
/usr/bin/x86_64-pc-linux-gnu-g++ -DHAVE_FFMPEG -DHAVE_FREETYPE -DHAVE_GLES2_EXT -DHAVE_OPENGL_EXT -DHAVE_TK -DHAVE_XLIB -DOCC_CONVERT_SIGNALS -DTKService_EXPORTS -I/usr/include/freetype2 -I/var/tmp/portage/sci-libs/opencascade-7.6.0-r2/work/occt-V7_6_0_build/include/opencascade  -std=c++0x -O2 -march=znver3 -pipe -g -ggdb3 -fexceptions -fPIC -Wa
ll -Wextra -fPIC -MD -MT src/TKService/CMakeFiles/TKService.dir/__/Media/Media_FormatContext.cxx.o -MF src/TKService/CMakeFiles/TKService.dir/__/Media/Media_FormatContext.cxx.o.d -o src/TKService/CMakeFiles/TKService.dir/__/Media/Media_FormatContext.cxx.o -c /var/tmp/portage/sci-libs/opencascade-7.6.0-r2/work/occt-V7_6_0/src/Media/Media_FormatCo
ntext.cxx
/var/tmp/portage/sci-libs/opencascade-7.6.0-r2/work/occt-V7_6_0/src/Media/Media_FormatContext.cxx: In member function ‘TCollection_AsciiString Media_FormatContext::StreamInfo(unsigned int, AVCodecContext*) const’:
/var/tmp/portage/sci-libs/opencascade-7.6.0-r2/work/occt-V7_6_0/src/Media/Media_FormatContext.cxx:413:25: error: ‘const AVStream’ {aka ‘const struct AVStream’} has no member named ‘codec’
  413 |     aCodecCtx = aStream.codec;
      |                         ^~~~~
/var/tmp/portage/sci-libs/opencascade-7.6.0-r2/work/occt-V7_6_0/src/Media/Media_FormatContext.cxx:418:3: error: ‘avcodec_string’ was not declared in this scope; did you mean ‘av_codec_iterate’?
  418 |   avcodec_string (aFrmtBuff, sizeof(aFrmtBuff), aCodecCtx, 0);
      |   ^~~~~~~~~~~~~~
      |   av_codec_iterate
/var/tmp/portage/sci-libs/opencascade-7.6.0-r2/work/occt-V7_6_0/src/Media/Media_FormatContext.cxx:446:18: error: invalid use of incomplete type ‘struct AVCodecContext’
  446 |     if (aCodecCtx->time_base.den != 0 && aCodecCtx->time_base.num != 0)
      |                  ^~
In file included from /var/tmp/portage/sci-libs/opencascade-7.6.0-r2/work/occt-V7_6_0_build/include/opencascade/Media_FormatContext.hxx:1,
                 from /var/tmp/portage/sci-libs/opencascade-7.6.0-r2/work/occt-V7_6_0/src/Media/Media_FormatContext.cxx:20:
/var/tmp/portage/sci-libs/opencascade-7.6.0-r2/work/occt-V7_6_0/src/Media/Media_FormatContext.hxx:22:8: note: forward declaration of ‘struct AVCodecContext’
   22 | struct AVCodecContext;
      |        ^~~~~~~~~~~~~~
/var/tmp/portage/sci-libs/opencascade-7.6.0-r2/work/occt-V7_6_0/src/Media/Media_FormatContext.cxx:446:51: error: invalid use of incomplete type ‘struct AVCodecContext’
  446 |     if (aCodecCtx->time_base.den != 0 && aCodecCtx->time_base.num != 0)
      |                                                   ^~
In file included from /var/tmp/portage/sci-libs/opencascade-7.6.0-r2/work/occt-V7_6_0_build/include/opencascade/Media_FormatContext.hxx:1,
                 from /var/tmp/portage/sci-libs/opencascade-7.6.0-r2/work/occt-V7_6_0/src/Media/Media_FormatContext.cxx:20:
/var/tmp/portage/sci-libs/opencascade-7.6.0-r2/work/occt-V7_6_0/src/Media/Media_FormatContext.hxx:22:8: note: forward declaration of ‘struct AVCodecContext’
   22 | struct AVCodecContext;
      |        ^~~~~~~~~~~~~~
/var/tmp/portage/sci-libs/opencascade-7.6.0-r2/work/occt-V7_6_0/src/Media/Media_FormatContext.cxx:448:85: error: invalid use of incomplete type ‘struct AVCodecContext’
  448 |       aStreamInfo += TCollection_AsciiString(", ") + formatFps(1 / av_q2d (aCodecCtx->time_base)) + " tbc";
      |                                                                                     ^~
In file included from /var/tmp/portage/sci-libs/opencascade-7.6.0-r2/work/occt-V7_6_0_build/include/opencascade/Media_FormatContext.hxx:1,
                 from /var/tmp/portage/sci-libs/opencascade-7.6.0-r2/work/occt-V7_6_0/src/Media/Media_FormatContext.cxx:20:
/var/tmp/portage/sci-libs/opencascade-7.6.0-r2/work/occt-V7_6_0/src/Media/Media_FormatContext.hxx:22:8: note: forward declaration of ‘struct AVCodecContext’
   22 | struct AVCodecContext;
      |        ^~~~~~~~~~~~~~
/var/tmp/portage/sci-libs/opencascade-7.6.0-r2/work/occt-V7_6_0/src/Media/Media_FormatContext.cxx: In member function ‘bool Media_FormatContext::SeekStream(unsigned int, double, bool)’:
/var/tmp/portage/sci-libs/opencascade-7.6.0-r2/work/occt-V7_6_0/src/Media/Media_FormatContext.cxx:502:79: error: ‘AVStream’ {aka ‘struct AVStream’} has no member named ‘cur_dts’
  502 |   for (int aTries = 10; isSeekDone && theToSeekBack && aTries > 0 && (aStream.cur_dts > aSeekTarget); --aTries)
      |                                                                               ^~~~~~~


Reproducible: Always
Comment 1 Kobboi 2022-02-28 21:38:24 UTC
Created attachment 766099 [details]
build.log.gz
Comment 2 Kobboi 2022-02-28 21:38:25 UTC
Created attachment 766100 [details]
emerge-info.txt
Comment 3 Kobboi 2022-02-28 21:47:57 UTC
Compiles fine with
* USE=ffmpeg and ffmpeg-4.4.1
* USE=-ffmpeg and ffmpeg-5.0
Comment 4 Bernd 2022-03-01 06:13:16 UTC
Thanks for the report. I'm gonna check, if 7.6.1 is working with ffmpeg-5 or else report upstream.
Comment 5 Bernd 2022-03-13 09:16:25 UTC
The issue also shows up in 7.6.1.
Reported upstream, see https://dev.opencascade.org/content/build-error-when-compiling-against-ffmpeg-5
Comment 6 Larry the Git Cow gentoo-dev 2022-03-16 22:51:15 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=088d1cd3dd668d0460b42632306fc612e13422e2

commit 088d1cd3dd668d0460b42632306fc612e13422e2
Author:     Bernd Waibel <waebbl-gentoo@posteo.net>
AuthorDate: 2022-03-13 09:47:01 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-03-16 22:51:01 +0000

    sci-libs/opencascade: backport fixes from v7.6.1
    
    Package is not yet compatible with ffmpeg-5, so we restrict to
    <media-video/ffmpeg-5. Reported upstream.
    Not compatible with musl libc implementation, so we explicitly
    DEPEND on sys-libs/glibc.
    
    Closes: https://bugs.gentoo.org/832742
    Closes: https://bugs.gentoo.org/834422
    Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
    Closes: https://github.com/gentoo/gentoo/pull/24525
    Signed-off-by: Sam James <sam@gentoo.org>

 .../{opencascade-7.6.0-r2.ebuild => opencascade-7.6.0-r3.ebuild}      | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5e6ca21c0846fea81d72cb8267b2ef2f66a5a755

commit 5e6ca21c0846fea81d72cb8267b2ef2f66a5a755
Author:     Bernd Waibel <waebbl-gentoo@posteo.net>
AuthorDate: 2022-03-13 09:42:04 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-03-16 22:50:59 +0000

    sci-libs/opencascade: bump to 7.6.1
    
    Package is not yet compatible with ffmpeg-5, so we restrict to
    <media-video/ffmpeg-5. Reported upstream.
    Not compatible with musl libc implementation, so we explicitly
    DEPEND on sys-libs/glibc.
    
    Closes: https://bugs.gentoo.org/835040
    Bug: https://bugs.gentoo.org/832742
    Bug: https://bugs.gentoo.org/834422
    Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
    Signed-off-by: Sam James <sam@gentoo.org>

 sci-libs/opencascade/Manifest                 |   1 +
 sci-libs/opencascade/opencascade-7.6.1.ebuild | 169 ++++++++++++++++++++++++++
 2 files changed, 170 insertions(+)
Comment 7 jospezial 2022-09-26 03:00:58 UTC
Please add the blocker for sci-libs/opencascade-7.5.3-r8 also.
And maybe to opencascade-7.5.2-r6.
The old ebuilds only have the warning comment for the bug.
There is no progress on the upstream bug report.

This is with ffmpeg-9999:

FAILED: src/TKService/CMakeFiles/TKService.dir/__/Image/Image_VideoRecorder.cxx.o 
/usr/lib/ccache/bin/x86_64-pc-linux-gnu-g++ -DHAVE_FFMPEG -DOCC_CONVERT_SIGNALS -DTKService_EXPORTS -I/usr/include/freetype2 -I/var/tmp/portage/sci-libs/opencascade-7.5.3-r8/work/occt-V7_5_3_build/include/opencascade  -std=c++0x -march=native -mtune=native -O2 -pipe -fexceptions -fPIC -Wall -Wextra -fPIC -MD -MT src/TKService/CMakeFiles/TKService.dir/__/Image/Image_VideoRecorder.cxx.o -MF src/TKService/CMakeFiles/TKService.dir/__/Image/Image_VideoRecorder.cxx.o.d -o src/TKService/CMakeFiles/TKService.dir/__/Image/Image_VideoRecorder.cxx.o -c /var/tmp/portage/sci-libs/opencascade-7.5.3-r8/work/occt-V7_5_3/src/Image/Image_VideoRecorder.cxx
/var/tmp/portage/sci-libs/opencascade-7.5.3-r8/work/occt-V7_5_3/src/Image/Image_VideoRecorder.cxx: In constructor ‘Image_VideoRecorder::Image_VideoRecorder()’:
/var/tmp/portage/sci-libs/opencascade-7.5.3-r8/work/occt-V7_5_3/src/Image/Image_VideoRecorder.cxx:82:3: error: ‘av_register_all’ was not declared in this scope
   82 |   av_register_all();
      |   ^~~~~~~~~~~~~~~
/var/tmp/portage/sci-libs/opencascade-7.5.3-r8/work/occt-V7_5_3/src/Image/Image_VideoRecorder.cxx: In member function ‘void Image_VideoRecorder::Close()’:
/var/tmp/portage/sci-libs/opencascade-7.5.3-r8/work/occt-V7_5_3/src/Image/Image_VideoRecorder.cxx:140:35: error: ‘struct AVStream’ has no member named ‘codec’
  140 |     avcodec_close (myVideoStream->codec);
      |                                   ^~~~~
/var/tmp/portage/sci-libs/opencascade-7.5.3-r8/work/occt-V7_5_3/src/Image/Image_VideoRecorder.cxx: In member function ‘Standard_Boolean Image_VideoRecorder::addVideoStream(const Image_VideoParams&, Standard_Integer)’:
/var/tmp/portage/sci-libs/opencascade-7.5.3-r8/work/occt-V7_5_3/src/Image/Image_VideoRecorder.cxx:245:49: error: invalid conversion from ‘const AVCodec*’ to ‘AVCodec*’ [-fpermissive]
  245 |     myVideoCodec = avcodec_find_encoder_by_name (theParams.VideoCodec.ToCString());
      |                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                 |
      |                                                 const AVCodec*
/var/tmp/portage/sci-libs/opencascade-7.5.3-r8/work/occt-V7_5_3/src/Image/Image_VideoRecorder.cxx:250:41: error: invalid conversion from ‘const AVCodec*’ to ‘AVCodec*’ [-fpermissive]
  250 |     myVideoCodec = avcodec_find_encoder ((AVCodecID )theDefCodecId);
      |                    ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                         |
      |                                         const AVCodec*
/var/tmp/portage/sci-libs/opencascade-7.5.3-r8/work/occt-V7_5_3/src/Image/Image_VideoRecorder.cxx:268:46: error: ‘struct AVStream’ has no member named ‘codec’
  268 |   AVCodecContext* aCodecCtx = myVideoStream->codec;
      |                                              ^~~~~
/var/tmp/portage/sci-libs/opencascade-7.5.3-r8/work/occt-V7_5_3/src/Image/Image_VideoRecorder.cxx: In member function ‘Standard_Boolean Image_VideoRecorder::openVideoCodec(const Image_VideoParams&)’:
/var/tmp/portage/sci-libs/opencascade-7.5.3-r8/work/occt-V7_5_3/src/Image/Image_VideoRecorder.cxx:300:46: error: ‘struct AVStream’ has no member named ‘codec’
  300 |   AVCodecContext* aCodecCtx = myVideoStream->codec;
      |                                              ^~~~~
/var/tmp/portage/sci-libs/opencascade-7.5.3-r8/work/occt-V7_5_3/src/Image/Image_VideoRecorder.cxx: In member function ‘Standard_Boolean Image_VideoRecorder::writeVideoFrame(Standard_Boolean)’:
/var/tmp/portage/sci-libs/opencascade-7.5.3-r8/work/occt-V7_5_3/src/Image/Image_VideoRecorder.cxx:435:46: error: ‘struct AVStream’ has no member named ‘codec’
  435 |   AVCodecContext* aCodecCtx = myVideoStream->codec;
      |                                              ^~~~~
/var/tmp/portage/sci-libs/opencascade-7.5.3-r8/work/occt-V7_5_3/src/Image/Image_VideoRecorder.cxx:453:14: error: ‘avcodec_encode_video2’ was not declared in this scope; did you mean ‘avcodec_encode_subtitle’?
  453 |     aResAv = avcodec_encode_video2 (aCodecCtx, &aPacket, theToFlush ? NULL : myFrame, &isGotPacket);
      |              ^~~~~~~~~~~~~~~~~~~~~
      |              avcodec_encode_subtitle
[2289/5625] /usr/lib/ccache/bin/x86_64-pc-linux-gnu-g++ -DHAVE_FFMPEG -DOCC_CONVERT_SIGNALS -DTKService_EXPORTS -I/usr/include/freetype2 -I/var/tmp/portage/sci-libs/opencascade-7.5.3-r8/work/occt-V7_5_3_build/include/opencascade  -std=c++0x -march=native -mtune=native -O2 -pipe -fexceptions -fPIC -Wall -Wextra -fPIC -MD -MT src/TKService/CMakeFiles/TKService.dir/__/Image/Image_Texture.cxx.o -MF src/TKService/CMakeFiles/TKService.dir/__/Image/Image_Texture.cxx.o.d -o src/TKService/CMakeFiles/TKService.dir/__/Image/Image_Texture.cxx.o -c /var/tmp/portage/sci-libs/opencascade-7.5.3-r8/work/occt-V7_5_3/src/Image/Image_Texture.cxx
[2290/5625] /usr/lib/ccache/bin/x86_64-pc-linux-gnu-g++ -DHAVE_FFMPEG -DOCC_CONVERT_SIGNALS -DTKService_EXPORTS -I/usr/include/freetype2 -I/var/tmp/portage/sci-libs/opencascade-7.5.3-r8/work/occt-V7_5_3_build/include/opencascade  -std=c++0x -march=native -mtune=native -O2 -pipe -fexceptions -fPIC -Wall -Wextra -fPIC -MD -MT src/TKService/CMakeFiles/TKService.dir/__/Media/Media_BufferPool.cxx.o -MF src/TKService/CMakeFiles/TKService.dir/__/Media/Media_BufferPool.cxx.o.d -o src/TKService/CMakeFiles/TKService.dir/__/Media/Media_BufferPool.cxx.o -c /var/tmp/portage/sci-libs/opencascade-7.5.3-r8/work/occt-V7_5_3/src/Media/Media_BufferPool.cxx
ninja: build stopped: subcommand failed.
 * ERROR: sci-libs/opencascade-7.5.3-r8::gentoo failed (compile phase):
 *   ninja -v -j3 -l0 failed
 * 
 * Call stack:
 *     ebuild.sh, line  122:  Called src_compile
 *   environment, line 2181:  Called cmake_src_compile
 *   environment, line  959:  Called cmake_build
 *   environment, line  928:  Called eninja
 *   environment, line 1379:  Called die
 * The specific snippet of code:
 *       "$@" || die "${nonfatal_args[@]}" "${*} failed"
Comment 8 Bernd 2022-09-26 05:09:10 UTC
Not sure if this has some purpose. Both of these versions are scheduled for removal and are only in the tree for single packages depending on them: ~sci-electronice/kicad-5.1.12 (masked) for 7.5.2 and dev-python/cadquery-ocp::science for 7.5.3.
Users should switch to 7.6.
Comment 9 jospezial 2023-04-27 00:43:48 UTC
Upstream has still not fixed it with 7.7.1

Another similar upstream bug report without progress:
https://dev.opencascade.org/content/compilation-error-ffmpeg-60
Comment 10 Luke A. Guest 2023-12-16 12:28:45 UTC
They have updated to 7.8.0 now.
Comment 11 jospezial 2023-12-16 14:02:11 UTC
(In reply to Luke A. Guest from comment #10)
> They have updated to 7.8.0 now.

Upstream did not change anything on the failing files.
https://git.dev.opencascade.org/gitweb/?p=occt.git;a=history;f=src/Image/Image_VideoRecorder.cxx;hb=HEAD

https://git.dev.opencascade.org/gitweb/?p=occt.git;a=history;f=src/Media/Media_FormatContext.cxx;hb=HEAD

No real progress on the upstream forum posts and bugs.
https://tracker.dev.opencascade.org/view.php?id=32871