[PR #3442] [MERGED] Tonemapping function relying on OpenCL filter and NVENC HEVC decoder #9526

Closed
opened 2026-02-07 06:03:44 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/3442
Author: @nyanmisaka
Created: 6/25/2020
Status: Merged
Merged: 9/4/2020
Merged by: @joshuaboniface

Base: masterHead: tonemap


📝 Commits (10+)

  • 7b862bb add Tonemapping relaying on nvdec and ocl
  • 4bdb870 Merge remote-tracking branch 'upstream/master' into tonemap
  • 5716453 minor changes
  • 95b961c remove unused line
  • df6b303 Merge branch 'master' into tonemap
  • 17527d6 fix build
  • 7b3f76b resolve conflicts
  • c23d991 Merge branch 'master' into tonemap
  • 54349fc fix outputSize
  • 4cb0a57 Merge branch 'master' into tonemap

📊 Changes

5 files changed (+187 additions, -63 deletions)

View changed files

📝 MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs (+123 -56)
📝 MediaBrowser.MediaEncoding/Probing/MediaStreamInfo.cs (+14 -0)
📝 MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs (+10 -0)
📝 MediaBrowser.Model/Configuration/EncodingOptions.cs (+28 -1)
📝 MediaBrowser.Model/Entities/MediaStream.cs (+12 -6)

📄 Description

Changes

These PRs rely on the tonemap_opencl filter based on the hardware acceleration of the OpenCL device, can cooperate with the NVENC HEVC decoder to perform tone mapping from HDR to SDR while maintaining a decent transcoding speed.

The current CPU-based tonemap method is very unsuitable for real-time transcoding in terms of speed.

Requirements

  • HEVC videos with HDR10(smpte2084) or HLG(arib-std-b67) metadata.
  • FFmpeg application file with opencl hwaccel type enabled. ffmpeg -hwaccels
  • NVIDIA Pascal and Turing or newer GPUs are recommended.
  • Keep the NVIDIA driver as up-to-date as possible on Windows 10.
  • NVIDIA proprietary drivers and the OpenCL runtime library are required on Linux.
  • Should get a bit better performance on Linux.

Shows

Issues
https://github.com/jellyfin/jellyfin/issues/415 was partially resolved with NVIDIA GPU.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/3442 **Author:** [@nyanmisaka](https://github.com/nyanmisaka) **Created:** 6/25/2020 **Status:** ✅ Merged **Merged:** 9/4/2020 **Merged by:** [@joshuaboniface](https://github.com/joshuaboniface) **Base:** `master` ← **Head:** `tonemap` --- ### 📝 Commits (10+) - [`7b862bb`](https://github.com/jellyfin/jellyfin/commit/7b862bba5aad345f0bc8d76bfb950590471ae232) add Tonemapping relaying on nvdec and ocl - [`4bdb870`](https://github.com/jellyfin/jellyfin/commit/4bdb870d16360502f8fcf7a3176aef1116dd42bb) Merge remote-tracking branch 'upstream/master' into tonemap - [`5716453`](https://github.com/jellyfin/jellyfin/commit/5716453542172443124db43790d4fde0f0abff10) minor changes - [`95b961c`](https://github.com/jellyfin/jellyfin/commit/95b961c8647b9db98d52631561cfc98224b905f7) remove unused line - [`df6b303`](https://github.com/jellyfin/jellyfin/commit/df6b303da79864dfe0feaf972a9fc3ae5bec3413) Merge branch 'master' into tonemap - [`17527d6`](https://github.com/jellyfin/jellyfin/commit/17527d68dfe2fa6fb7755f819f03ada5165cb23d) fix build - [`7b3f76b`](https://github.com/jellyfin/jellyfin/commit/7b3f76b81fd92d30ac8783508fb7b6793d32ec95) resolve conflicts - [`c23d991`](https://github.com/jellyfin/jellyfin/commit/c23d991c95a45b9cb60f546c2490ca8f2a8d9dc0) Merge branch 'master' into tonemap - [`54349fc`](https://github.com/jellyfin/jellyfin/commit/54349fc94597824714f623b8c31583fc044274aa) fix outputSize - [`4cb0a57`](https://github.com/jellyfin/jellyfin/commit/4cb0a57e4645aba8e5e65c7d086091b9161c6c09) Merge branch 'master' into tonemap ### 📊 Changes **5 files changed** (+187 additions, -63 deletions) <details> <summary>View changed files</summary> 📝 `MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs` (+123 -56) 📝 `MediaBrowser.MediaEncoding/Probing/MediaStreamInfo.cs` (+14 -0) 📝 `MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs` (+10 -0) 📝 `MediaBrowser.Model/Configuration/EncodingOptions.cs` (+28 -1) 📝 `MediaBrowser.Model/Entities/MediaStream.cs` (+12 -6) </details> ### 📄 Description **Changes** - Part1 -- This - Part2 -- https://github.com/jellyfin/jellyfin-web/pull/1487 These PRs rely on the `tonemap_opencl` filter based on the hardware acceleration of the OpenCL device, can cooperate with the NVENC HEVC decoder to perform tone mapping from HDR to SDR while maintaining a decent transcoding speed. The current CPU-based tonemap method is very unsuitable for real-time transcoding in terms of speed. **Requirements** - HEVC videos with HDR10(smpte2084) or HLG(arib-std-b67) metadata. - FFmpeg application file with `opencl` hwaccel type enabled. `ffmpeg -hwaccels` - NVIDIA Pascal and Turing or newer GPUs are recommended. - Keep the NVIDIA driver as up-to-date as possible on Windows 10. - NVIDIA proprietary drivers and the OpenCL runtime library are required on Linux. - Should get a bit better performance on Linux. **Shows** - Windows 10 + Driver 451.67 - 4K HEVC HDR10 -> 1080P 15M 20M - [Sony_4K60_HDR_Camp.mp4](https://4kmedia.org/sony-camping-in-nature-4k-demo/) ![cmp01](https://user-images.githubusercontent.com/14953024/85730563-53c3b400-b72c-11ea-9af9-05fd7bb9c3a0.png) - [SONY.BRAVIA.OLED.4K.HDR.DEMO_Food .Fizzle.mp4](https://4kmedia.org/sony-food-fizzle-uhd-hdr-4k-demo/) ![cmp02](https://user-images.githubusercontent.com/14953024/85730742-7ce44480-b72c-11ea-835a-ec4bc27e73d8.png) - NVIDIA GTX 1050 4G - Stats(1050) ![gtx1050](https://user-images.githubusercontent.com/14953024/88537553-5aea2480-d040-11ea-879a-1a60f8dac92c.png) - NVIDIA GTX 1660 - Stats(1660) ![stats_1660](https://user-images.githubusercontent.com/14953024/90014110-1a91d400-dcd9-11ea-92aa-0d4abf248562.png) - Dashboard ![dashboard](https://user-images.githubusercontent.com/14953024/85732005-9639c080-b72d-11ea-9657-9ee27086ad5f.png) **Issues** https://github.com/jellyfin/jellyfin/issues/415 was partially resolved with NVIDIA GPU. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-07 06:03:44 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#9526