Bug 270209 - www/qt5-webengine: Fails to build with FFmpeg 6.0
Summary: www/qt5-webengine: Fails to build with FFmpeg 6.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Kai Knoblich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-14 12:24 UTC by Daniel Engberg
Modified: 2023-04-27 17:25 UTC (History)
3 users (show)

See Also:
tcberner: maintainer-feedback+


Attachments
qt5-webengine-add-support-for-newer-ffmpeg.patch (6.88 KB, patch)
2023-03-19 13:10 UTC, Kai Knoblich
kai: maintainer-approval+
Details | Diff
ffmpeg6.0-with-av_stream_get_first_dts-symbol.patch (66.93 KB, patch)
2023-03-19 13:11 UTC, Kai Knoblich
no flags Details | Diff
qt5-webengine-complate-patch-based-on-ffmpeg-6.0-v3.patch (8.65 KB, patch)
2023-04-19 20:26 UTC, Kai Knoblich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Comment 1 Tobias C. Berner freebsd_committer freebsd_triage 2023-03-14 17:35:51 UTC
@kai, could you take a look at this?


mfg Tobias
Comment 2 Kai Knoblich freebsd_committer freebsd_triage 2023-03-17 06:40:26 UTC
(In reply to Tobias C. Berner from comment #1)

Thanks for the heads-up. I'm going to take a look into it which will take a while.
Comment 3 Kai Knoblich freebsd_committer freebsd_triage 2023-03-19 13:10:32 UTC
Created attachment 240975 [details]
qt5-webengine-add-support-for-newer-ffmpeg.patch
Comment 4 Kai Knoblich freebsd_committer freebsd_triage 2023-03-19 13:11:19 UTC
Created attachment 240976 [details]
ffmpeg6.0-with-av_stream_get_first_dts-symbol.patch
Comment 5 Kai Knoblich freebsd_committer freebsd_triage 2023-03-19 13:14:11 UTC
Using the patches [1] from ArchLinux for FFmpeg 5+ compatibility reduces the emitted error messages as reported in bug #261302 comment #44.  But there are still some errors:

[...]
./../../../../qtwebengine-everywhere-src-5.15.8/src/3rdparty/chromium/media/filters/ffmpeg_demuxer.cc:101:7: error: use of undeclared identifier 'av_stream_get_first_dts'; d
id you mean 'av_stream_get_end_pts'?
./../../../../qtwebengine-everywhere-src-5.15.8/src/3rdparty/chromium/media/filters/ffmpeg_demuxer.cc:106:48: error: use of undeclared identifier 'av_stream_get_first_dts';
did you mean 'av_stream_get_end_pts'?
[...]

If you add the patches [2] for ffmpeg from ArchLinux, which adds the "av_stream_get_first_dts" symbol, the building of www/qt5-webengine suceeds.

As far as I can see, the following options would be given at the moment:

Option a) 
- Use the patch (= ffmpeg6.0-with-av_stream_get_first_dts-symbol.patch) for FFmpeg 6.0
- Once FFmpeg 6.0 lands into the ports tree, commit the patch (= qt5-webengine-add-support-for-new-ffmpeg.patch) for www/qt5-webengine as soon as possible and bump the PORTREVISION.

Option b)
- Switch to the bundled ffmpeg of www/qt5-webengine.

What do you (kde@, multimedia@, community) think about it?
--
[1] https://github.com/archlinux/svntogit-packages/blob/packages/qt5-webengine/trunk/qt5-webengine-ffmpeg5.patch
[2] https://github.com/archlinux/svntogit-packages/blob/packages/ffmpeg/trunk/add-av_stream_get_first_dts-for-chromium.patch
Comment 6 Daniel Engberg freebsd_committer freebsd_triage 2023-03-19 19:42:09 UTC
We already have a few ports confirmed to only work with FFmpeg 6.0 after being patched/updated so if my opinion is of any worth I think we can bump it afterwards. If that's deemed acceptable just change from Blocks to Depends on for this bugs report so there aren't any misunderstandings.
Comment 7 Daniel Engberg freebsd_committer freebsd_triage 2023-03-19 19:42:31 UTC
..and of course, many thanks looking into this! :)
Comment 8 George Mitchell 2023-03-27 17:40:40 UTC
I'm still on ffmpeg-4.4.3_4,1, but I'm unable to compile qt5-webengine 5.15.8.  It dies at the stage of linking libQt5WebEngine.so.5.15.8:

/usr/local/bin/ld: .obj/qquickwebengineview.o: in function `QQuickWebEngineViewPrivate::~QQuickWebEngineViewPrivate()':
qquickwebengineview.cpp:(.text+0x4a6): undefined reference to `QtWebEngineCore::closingDown()'
/usr/local/bin/ld: .obj/qquickwebengineview.o: in function `QQuickWebEngineViewPrivate::bindViewAndWidget(QQuickWebEngineView*, QtWebEngineCore::RenderWidgetHostViewQtDelegateQuick*)':
qquickwebengineview.cpp:(.text+0x6ed): undefined reference to `QtWebEngineCore::closingDown()'
/usr/local/bin/ld: .obj/qquickwebengineview.o: in function `QQuickWebEngineViewPrivate::releaseProfile()':
qquickwebengineview.cpp:(.text+0x845): undefined reference to `QtWebEngineCore::closingDown()'
/usr/local/bin/ld: .obj/qquickwebengineview.o: in function `QQuickWebEngineViewPrivate::widgetChanged(QtWebEngineCore::RenderWidgetHostViewQtDelegateQuick*, QtWebEngineCore::RenderWidgetHostViewQtDelegateQuick*)':
qquickwebengineview.cpp:(.text+0x3b18): undefined reference to `QtWebEngineCore::closingDown()'

Is that related to this bug, or is it a new and different one?
Comment 9 George Mitchell 2023-03-27 20:06:16 UTC
Correction to my previous comment: After updating my ports tree, all of a sudden I AM using ffmpeg 6.  I'm trying out the patches now.
Comment 10 Daniel Engberg freebsd_committer freebsd_triage 2023-03-27 20:10:07 UTC
(In reply to George Mitchell from comment #9)
fyi, https://github.com/freebsd/poudriere/pull/1046
Comment 11 George Mitchell 2023-03-27 20:33:44 UTC
Thanks for the pointer, but I have a case of terminal allergy to poudriere, so fortunately my build should not be subject to the max files problem.  (I'm a dyed-in-the-wool fan of portmaster, and updating only when I have to fix a security problem.)
Comment 12 George Mitchell 2023-03-27 22:46:12 UTC
My build failed again, but I've convinced myself it's a different problem than this bug.  Once I have a complete build log with MAKE_JOBS_UNSAFE=yes, I'll file a new bug report.
Comment 13 Kai Knoblich freebsd_committer freebsd_triage 2023-03-28 10:26:35 UTC
(In reply to George Mitchell from comment #12)

Thanks for the all info, especially the fact that portmaster is used. Have you already tried the instructions of the UPDATING entry of 20230306?

If already tried, then a new bug report must be created as you already mentioned as the errors aren't related to FFmpeg 6.0.
Comment 14 George Mitchell 2023-03-28 17:40:17 UTC
Thanks for the reminder!  Indeed, removing the previous version was what I needed to do, and now everything compiles perfectly.  So I confirm that using the patches here does allow compiling with ffmpeg 6.
Comment 15 Daniel Engberg freebsd_committer freebsd_triage 2023-04-19 18:58:49 UTC
Hi Kai,

Can you have a look at this again as it seems like something is failing :/
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=261302#c69

We're likely to commit FFmpeg 6 soon

Can you also supply a patch for ffmpeg that applies on top of jbeich's? That would be a lot easier to commit.

Best regards,
Daniel
Comment 16 Kai Knoblich freebsd_committer freebsd_triage 2023-04-19 20:26:44 UTC
Created attachment 241596 [details]
qt5-webengine-complate-patch-based-on-ffmpeg-6.0-v3.patch

(In reply to Daniel Engberg from comment #15)

Hi Daniel, thanks for the info. As already stated in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=261302#c60, multimedia/ffmpeg needs also an additional patch.

I've attached a patch (based on my previous two patches) on top of jbeich's actual version (= v3) of the patch for ffmpeg 6.0:

- Add the symbol for "av_stream_get_first_dts" to multimedia/ffmpeg
- Add support for ffmpeg 5+ for www/qt5-webengine
- Bump the PORTREVISION of www/qt5-webengine

Please note: My own builder is currently oversubscribed, so I cannot confirm a successful build at this time of writing.
Comment 17 commit-hook freebsd_committer freebsd_triage 2023-04-27 12:04:59 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d4d975cffa333bd1b88fcdaf1f0c8f3aa79728b9

commit d4d975cffa333bd1b88fcdaf1f0c8f3aa79728b9
Author:     Kai Knoblich <kai@FreeBSD.org>
AuthorDate: 2023-04-27 11:22:52 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2023-04-27 12:01:46 +0000

    multimedia/ffmpeg: Import compatibility patch for qt5-webengine

    Add symbol for "av_stream_get_first_dts" to ffmpeg

    PR:             270209

 ...av_stream_get_first_dts-for-qt5-webengine (new) | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)
Comment 18 commit-hook freebsd_committer freebsd_triage 2023-04-27 12:05:21 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9400fe7480540a0cdcbc6068fca8d3fc5144322d

commit 9400fe7480540a0cdcbc6068fca8d3fc5144322d
Author:     Kai Knoblich <kai@FreeBSD.org>
AuthorDate: 2023-04-27 11:20:21 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2023-04-27 12:01:46 +0000

    www/qt5-webengine: Add support for FFmpeg 6

    Import patches to fix build with FFmpeg 6

    PR:             270209

 .../patch-add-support-for-ffmpeg5-and-later (new)  | 140 +++++++++++++++++++++
 1 file changed, 140 insertions(+)
Comment 19 Daniel Engberg freebsd_committer freebsd_triage 2023-04-27 17:25:07 UTC
Committed, thanks