Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use Metal tonemap instead of OpenCL #11198

Merged
merged 4 commits into from
Mar 24, 2024
Merged

fix: use Metal tonemap instead of OpenCL #11198

merged 4 commits into from
Mar 24, 2024

Conversation

gnattu
Copy link
Member

@gnattu gnattu commented Mar 23, 2024

Changes

As discussed in jellyfin/jellyfin-ffmpeg#357, the current OpenCL kernel runs extremely slow on Apple Silicon. This change updates the filter chain to use the Metal implementation of the tone map filter to handle Dolby Vision Profile 5 videos introduced by jellyfin/jellyfin-ffmpeg#369.

For Intel Macs, the OpenCL kernel is not compatible with certain GPUs and we will have the following error:

[AVHWDeviceContext @ 0x7faa2510e200] OpenCL error: [CL_IMAGE_FORMAT_NOT_SUPPORTED] : OpenCL Error : clCreateImage failed: The specified format is not supported for the specified image type.
[Parsed_tonemap_opencl_5 @ 0x7faa2510b940] Failed to create image for dither matrix: -10.

We need the Metal kernel to properly support Intel Macs.

Issues

@gnattu
Copy link
Member Author

gnattu commented Mar 23, 2024

Mark as draft until decisions are made about whether this will be included in 10.9.

@nyanmisaka nyanmisaka marked this pull request as ready for review March 23, 2024 08:44
@jellyfin-bot jellyfin-bot added the merge conflict Merge conflicts should be resolved before a merge label Mar 23, 2024
@jellyfin-bot
Copy link
Contributor

This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged.

gnattu added 2 commits March 23, 2024 22:13
Signed-off-by: gnattu <gnattuoc@me.com>
Signed-off-by: gnattu <gnattuoc@me.com>
@gnattu gnattu force-pushed the use-metal-tonemap branch from e3cc4ce to bc5dbfb Compare March 23, 2024 14:15
@jellyfin-bot jellyfin-bot removed the merge conflict Merge conflicts should be resolved before a merge label Mar 23, 2024
gnattu added 2 commits March 24, 2024 00:34
Signed-off-by: gnattu <gnattuoc@me.com>
Signed-off-by: gnattu <gnattuoc@me.com>
@nyanmisaka
Copy link
Member

It's probably worth mentioning that tonemap_opencl doesn't work on Intel based Macs. Also change the title feat->fix: xxx.

@gnattu gnattu changed the title feat: use Metal tonemap instead of OpenCL fix: use Metal tonemap instead of OpenCL Mar 23, 2024
Copy link
Member

@nyanmisaka nyanmisaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then we will have to tag a jf-ffmpeg 6.0.1-5 before RC1 to match this changes.

@nyanmisaka
Copy link
Member

@crobibero crobibero merged commit b187079 into master Mar 24, 2024
12 checks passed
@crobibero crobibero deleted the use-metal-tonemap branch March 24, 2024 14:20
SourSulfur pushed a commit to SourSulfur/jellyfin that referenced this pull request Apr 19, 2024
SourSulfur pushed a commit to SourSulfur/jellyfin that referenced this pull request Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants