[PR #13277] [MERGED] Improve dynamic HDR metadata handling #13523

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

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/13277
Author: @gnattu
Created: 12/23/2024
Status: Merged
Merged: 4/3/2025
Merged by: @crobibero

Base: masterHead: hdr-metadata-handling


📝 Commits (10+)

  • 695a2d3 Add support for bitstream filter to remove dynamic hdr metadata
  • a43e1e6 Add support for ffprobe's only_first_vframe for HDR10+ detection
  • 0e6272d Add BitStreamFilterOptionType for metadata removal check
  • 9392232 Map HDR10+ metadata to VideoRangeType.cs
  • ed86c5f Add more Dolby Vision Range types
  • 45e9d63 Remove dynamic hdr metadata when necessary
  • c5bb1ab Allow direct playback of HDR10+ videos on HDR10 clients
  • bdcf8ad Only use dovi codec tag when dovi metadata is not removed
  • b4034a6 Handle DV Profile 7 Videos better
  • 1f17fbe Fix HDR10+ with new bitmask

📊 Changes

21 files changed (+2327 additions, -66 deletions)

View changed files

📝 Jellyfin.Api/Controllers/DynamicHlsController.cs (+5 -4)
📝 Jellyfin.Api/Helpers/DynamicHlsHelper.cs (+59 -26)
📝 Jellyfin.Data/Enums/VideoRangeType.cs (+21 -0)
📝 Jellyfin.Server.Implementations/Item/MediaStreamRepository.cs (+3 -1)
MediaBrowser.Controller/MediaEncoding/BitStreamFilterOptionType.cs (+32 -0)
📝 MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs (+191 -20)
📝 MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs (+1 -0)
📝 MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs (+7 -0)
📝 MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs (+46 -0)
📝 MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs (+20 -0)
📝 MediaBrowser.MediaEncoding/Probing/InternalMediaInfoResult.cs (+7 -0)
MediaBrowser.MediaEncoding/Probing/MediaFrameInfo.cs (+184 -0)
MediaBrowser.MediaEncoding/Probing/MediaFrameSideDataInfo.cs (+16 -0)
📝 MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs (+13 -2)
📝 MediaBrowser.Model/Dlna/ConditionProcessor.cs (+9 -0)
📝 MediaBrowser.Model/Dlna/StreamInfo.cs (+1 -0)
📝 MediaBrowser.Model/Entities/MediaStream.cs (+24 -13)
📝 src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/MediaStreamInfo.cs (+2 -0)
src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20250327171413_AddHdr10PlusFlag.Designer.cs (+1655 -0)
src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20250327171413_AddHdr10PlusFlag.cs (+28 -0)

...and 1 more files

📄 Description

Changes

This is a relatively big change to the way advanced HDR formats are handled. Previously, we were only checking HDR10, HLG, and Dolby Vision files, with a naive mapping of fallbacks. While this approach was somewhat effective, we continue to encounter compatibility issues. This PR addresses these issues by:

  • Properly detecting HDR10+ videos and assigning the corresponding VideoRangeType.
  • Introducing additional Dolby Vision VideoRangeType variants to address common compatibility issues, such as Profile 7 videos, videos with invalid or out-of-specification profile values, and Dolby Vision HDR10+ hybrid videos.
  • Implementing a functionality to remove dynamic HDR metadata (Dolby Vision or HDR10+) when necessary to mitigate compatibility issues from the client side.

Metadata rescan on the already indexed problematic files would be necessary.

Current implementation is abusing the EL flag field to avoid changing the database schema. Should add a proper field once #12798 is merged. Done

Issues

Depends on https://github.com/jellyfin/jellyfin-ffmpeg/pull/519

Fixes jellyfin/jellyfin-androidtv#4021
Fixes jellyfin/jellyfin-androidtv#2700
Fixes jellyfin/jellyfin-androidtv#2630
Fixes #11275

Closes feature request: https://features.jellyfin.org/posts/2557/support-for-playing-dv-profile-7-hybrid-dv-hdr-files-on-non-dv-hdr-device


🔄 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/13277 **Author:** [@gnattu](https://github.com/gnattu) **Created:** 12/23/2024 **Status:** ✅ Merged **Merged:** 4/3/2025 **Merged by:** [@crobibero](https://github.com/crobibero) **Base:** `master` ← **Head:** `hdr-metadata-handling` --- ### 📝 Commits (10+) - [`695a2d3`](https://github.com/jellyfin/jellyfin/commit/695a2d3b5a7ed3a4d233127802684870de6c96de) Add support for bitstream filter to remove dynamic hdr metadata - [`a43e1e6`](https://github.com/jellyfin/jellyfin/commit/a43e1e6c6c4a1634070057c4491c430f3a9f99ef) Add support for ffprobe's only_first_vframe for HDR10+ detection - [`0e6272d`](https://github.com/jellyfin/jellyfin/commit/0e6272d7eadfe54e64b74379e1d64fd6824dc1bf) Add BitStreamFilterOptionType for metadata removal check - [`9392232`](https://github.com/jellyfin/jellyfin/commit/93922327be4badbbd3f99a14cfe43eadea180e80) Map HDR10+ metadata to VideoRangeType.cs - [`ed86c5f`](https://github.com/jellyfin/jellyfin/commit/ed86c5f496de5a78d7d6425416f4cc38cda7552a) Add more Dolby Vision Range types - [`45e9d63`](https://github.com/jellyfin/jellyfin/commit/45e9d63bb5db88fb59131fbcc054e442c62556a7) Remove dynamic hdr metadata when necessary - [`c5bb1ab`](https://github.com/jellyfin/jellyfin/commit/c5bb1ab5a1b448c4e60880104ed0a9fc05a3373c) Allow direct playback of HDR10+ videos on HDR10 clients - [`bdcf8ad`](https://github.com/jellyfin/jellyfin/commit/bdcf8ad430654ffb3653da6190d4c415ca5d4540) Only use dovi codec tag when dovi metadata is not removed - [`b4034a6`](https://github.com/jellyfin/jellyfin/commit/b4034a6f3cf5d397c871f607327588fa04b32131) Handle DV Profile 7 Videos better - [`1f17fbe`](https://github.com/jellyfin/jellyfin/commit/1f17fbe4495a3490f7213e5f3b5fcd143a6d487f) Fix HDR10+ with new bitmask ### 📊 Changes **21 files changed** (+2327 additions, -66 deletions) <details> <summary>View changed files</summary> 📝 `Jellyfin.Api/Controllers/DynamicHlsController.cs` (+5 -4) 📝 `Jellyfin.Api/Helpers/DynamicHlsHelper.cs` (+59 -26) 📝 `Jellyfin.Data/Enums/VideoRangeType.cs` (+21 -0) 📝 `Jellyfin.Server.Implementations/Item/MediaStreamRepository.cs` (+3 -1) ➕ `MediaBrowser.Controller/MediaEncoding/BitStreamFilterOptionType.cs` (+32 -0) 📝 `MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs` (+191 -20) 📝 `MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs` (+1 -0) 📝 `MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs` (+7 -0) 📝 `MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs` (+46 -0) 📝 `MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs` (+20 -0) 📝 `MediaBrowser.MediaEncoding/Probing/InternalMediaInfoResult.cs` (+7 -0) ➕ `MediaBrowser.MediaEncoding/Probing/MediaFrameInfo.cs` (+184 -0) ➕ `MediaBrowser.MediaEncoding/Probing/MediaFrameSideDataInfo.cs` (+16 -0) 📝 `MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs` (+13 -2) 📝 `MediaBrowser.Model/Dlna/ConditionProcessor.cs` (+9 -0) 📝 `MediaBrowser.Model/Dlna/StreamInfo.cs` (+1 -0) 📝 `MediaBrowser.Model/Entities/MediaStream.cs` (+24 -13) 📝 `src/Jellyfin.Database/Jellyfin.Database.Implementations/Entities/MediaStreamInfo.cs` (+2 -0) ➕ `src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20250327171413_AddHdr10PlusFlag.Designer.cs` (+1655 -0) ➕ `src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20250327171413_AddHdr10PlusFlag.cs` (+28 -0) _...and 1 more files_ </details> ### 📄 Description <!-- Ensure your title is short, descriptive, and in the imperative mood (Fix X, Change Y, instead of Fixed X, Changed Y). For a good inspiration of what to write in commit messages and PRs please review https://chris.beams.io/posts/git-commit/ and our documentation. --> **Changes** <!-- Describe your changes here in 1-5 sentences. --> This is a relatively big change to the way advanced HDR formats are handled. Previously, we were only checking HDR10, HLG, and Dolby Vision files, with a naive mapping of fallbacks. While this approach was somewhat effective, we continue to encounter compatibility issues. This PR addresses these issues by: - Properly detecting HDR10+ videos and assigning the corresponding `VideoRangeType`. - Introducing additional Dolby Vision `VideoRangeType` variants to address common compatibility issues, such as Profile 7 videos, videos with invalid or out-of-specification profile values, and Dolby Vision HDR10+ hybrid videos. - Implementing a functionality to remove dynamic HDR metadata (Dolby Vision or HDR10+) when necessary to mitigate compatibility issues from the client side. Metadata rescan on the already indexed problematic files would be necessary. ~~Current implementation is abusing the EL flag field to avoid changing the database schema. Should add a proper field once #12798 is merged.~~ Done **Issues** <!-- Tag any issues that this PR solves here. ex. Fixes # --> Depends on https://github.com/jellyfin/jellyfin-ffmpeg/pull/519 Fixes jellyfin/jellyfin-androidtv#4021 Fixes jellyfin/jellyfin-androidtv#2700 Fixes jellyfin/jellyfin-androidtv#2630 Fixes #11275 Closes feature request: https://features.jellyfin.org/posts/2557/support-for-playing-dv-profile-7-hybrid-dv-hdr-files-on-non-dv-hdr-device --- <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 07:14:27 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#13523