Bug 270237 - multimedia/kodi: Fails to build with FFmpeg 6.0
Summary: multimedia/kodi: 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: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-15 10:17 UTC by Daniel Engberg
Modified: 2023-06-17 11:37 UTC (History)
3 users (show)

See Also:
yzrh: maintainer-feedback+


Attachments
Patch from upstream (78.91 KB, patch)
2023-03-15 23:50 UTC, yzrh
no flags Details | Diff
testport log (bzip2) (113.58 KB, application/x-bzip)
2023-03-15 23:51 UTC, yzrh
no flags Details
Patch from upstream (fix DVD playback) (80.74 KB, patch)
2023-03-16 22:18 UTC, yzrh
no flags Details | Diff
testport log (bzip2, r1) (112.96 KB, application/x-bzip)
2023-03-16 22:19 UTC, yzrh
no flags Details
Patch from upstream (merged) (81.33 KB, patch)
2023-04-19 14:12 UTC, yzrh
no flags Details | Diff
testport log (bzip2, r2) (112.75 KB, application/x-bzip)
2023-04-19 14:12 UTC, yzrh
no flags Details
Kodi 20 with ffmpeg 6 log - dolby transcoding broken (39.58 KB, text/plain)
2023-06-13 19:57 UTC, js
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Engberg freebsd_committer freebsd_triage 2023-03-15 10:17:42 UTC
Hi,

Can you look into what options we have since we're moving to FFmpeg 6.0?

I found a few refences but having a quick look at the repo it doesn't seem to be backported to 20.x?

References:
https://github.com/xbmc/xbmc/issues/21766
https://github.com/xbmc/xbmc/pull/21248
https://github.com/xbmc/xbmc/pull/22899

Best regards,
Daniel
Comment 1 Bernhard Froehlich freebsd_committer freebsd_triage 2023-03-15 16:29:14 UTC
I'm not authoritative on this but from what I have read in the mentioned PR upstream kodi is always only targeting one ffmpeg release per Kodi major version. For Kodi 20/Nexus this is ffmpeg 4.4.1. They also mention that Kodi brings his own internal ffmpeg 4.4.1 as a fallback if their cmake does not find a matching system ffmpeg but I don't know if that is useable on FreeBSD.

It is also unclear to me if updating ffmpeg could have any side effects on kodi plugins or not.
Comment 2 yzrh 2023-03-15 18:09:05 UTC
The support is being worked on: https://github.com/xbmc/xbmc/pull/22967,
and looks like it does work in its current form.

API changes seem minimal, I should be able to backport it
for Kodi 20.  If you can point me to a ports tree with FFmpeg 6.0 to test
against?
Comment 3 yzrh 2023-03-15 18:16:29 UTC
(In reply to Bernhard Froehlich from comment #1)

The fallback system involves downloading a source tarball
during build time.  You can already tell why it won't work...
Comment 4 Daniel Engberg freebsd_committer freebsd_triage 2023-03-15 18:53:01 UTC
There's a patch in the referenced bug report (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=261302) bumping multimedia/ffmpeg to 6.0

Best regards,
Daniel
Comment 5 yzrh 2023-03-15 23:50:47 UTC
Created attachment 240886 [details]
Patch from upstream
Comment 6 yzrh 2023-03-15 23:51:30 UTC
Created attachment 240887 [details]
testport log (bzip2)
Comment 7 yzrh 2023-03-15 23:54:47 UTC
(In reply to yzrh from comment #5)

Builds with no error.  Ready for multimedia/kodi/files, something
like multimedia/kodi/files/patch-ffmpeg.

As I said, it is a work in progress.  I will fix any bug discovered later.

Many thanks!
Comment 8 yzrh 2023-03-16 22:18:56 UTC
Created attachment 240906 [details]
Patch from upstream (fix DVD playback)

Includes an important fix from upstream.  Backport for 20.x.
Comment 9 yzrh 2023-03-16 22:19:38 UTC
Created attachment 240907 [details]
testport log (bzip2, r1)
Comment 10 yzrh 2023-03-16 22:31:39 UTC
Can it be committed as soon as FFmpeg 6.0 lands?
Comment 11 Daniel Engberg freebsd_committer freebsd_triage 2023-03-17 06:14:28 UTC
Thanks for looking into it and sure, we'll arrange that.
Comment 12 yzrh 2023-04-19 14:12:05 UTC
Created attachment 241584 [details]
Patch from upstream (merged)
Comment 13 yzrh 2023-04-19 14:12:30 UTC
Created attachment 241585 [details]
testport log (bzip2, r2)
Comment 14 yzrh 2023-04-19 14:24:46 UTC
This is the final revision for backport, upstream merged ffmpeg 6 support.
Comment 15 commit-hook freebsd_committer freebsd_triage 2023-04-27 12:05:08 UTC
A commit in branch main references this bug:

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

commit 915391ac40ad0175583f572d999680f5ae8397bc
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2023-04-27 10:43:32 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2023-04-27 12:01:44 +0000

    multimedia/kodi: Add patch to support FFmpeg 6

    Add patch from maintainer

    PR:             270237
    Reviewed by:    yrzh <yzrh@noema.org> (maintainer)

 multimedia/kodi/files/patch-ffmpeg6-support (new) | 2150 +++++++++++++++++++++
 1 file changed, 2150 insertions(+)
Comment 16 Daniel Engberg freebsd_committer freebsd_triage 2023-04-27 17:25:53 UTC
Committed, thanks
Comment 17 js 2023-06-13 19:57:14 UTC
Created attachment 242768 [details]
Kodi 20 with ffmpeg 6 log - dolby transcoding broken
Comment 18 js 2023-06-13 19:58:53 UTC
Audio passthrough with Dolby Digital is not working for me with kodi 20 / ffmpeg 6.  I'm getting no audio when passthrough is enabled and configured correctly. 
Attached my kodi.log file.

How about using existing port ffmpeg4 (currently at 4.4.4) with kodi instead of current ffmpeg port which is now at 6?

I'm using recommended settings for my set up as stated on https://kodi.wiki/view/Audio_quickstart_guide. I've set output device to my HDMI device, set "Number of Channels" to 2, disabled "Stereo upmix", enabled "Dolby Digital (AC3) capable receiver" and "Enable Dolby Digital transcoding".

The same settings worked great for me with Kodi 18 / ffmpeg 4.3 and exact same hardware and setup.

If I unset "Enable Dolby Digital transcoding" I get audio from front speakers, but no surround sound.
Comment 19 yzrh 2023-06-17 11:37:06 UTC
Thanks for the bug report.  I should be able to fix the encoding,
I will open a new bug for that.