diff --git a/MediaBrowser.MediaEncoding/Probing/MediaStreamInfo.cs b/MediaBrowser.MediaEncoding/Probing/MediaStreamInfo.cs index c9c8c34c2e..eab8f79bb3 100644 --- a/MediaBrowser.MediaEncoding/Probing/MediaStreamInfo.cs +++ b/MediaBrowser.MediaEncoding/Probing/MediaStreamInfo.cs @@ -310,5 +310,12 @@ namespace MediaBrowser.MediaEncoding.Probing /// The color primaries. [JsonPropertyName("color_primaries")] public string ColorPrimaries { get; set; } + + /// + /// Gets or sets the side_data_list. + /// + /// The side_data_list. + [JsonPropertyName("side_data_list")] + public IReadOnlyList SideDataList { get; set; } } } diff --git a/MediaBrowser.MediaEncoding/Probing/MediaStreamInfoSideData.cs b/MediaBrowser.MediaEncoding/Probing/MediaStreamInfoSideData.cs new file mode 100644 index 0000000000..095757bef7 --- /dev/null +++ b/MediaBrowser.MediaEncoding/Probing/MediaStreamInfoSideData.cs @@ -0,0 +1,74 @@ +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace MediaBrowser.MediaEncoding.Probing +{ + /// + /// Class MediaStreamInfoSideData. + /// + public class MediaStreamInfoSideData + { + /// + /// Gets or sets the SideDataType. + /// + /// The SideDataType. + [JsonPropertyName("side_data_type")] + public string? SideDataType { get; set; } + + /// + /// Gets or sets the DvVersionMajor. + /// + /// The DvVersionMajor. + [JsonPropertyName("dv_version_major")] + public int? DvVersionMajor { get; set; } + + /// + /// Gets or sets the DvVersionMinor. + /// + /// The DvVersionMinor. + [JsonPropertyName("dv_version_minor")] + public int? DvVersionMinor { get; set; } + + /// + /// Gets or sets the DvProfile. + /// + /// The DvProfile. + [JsonPropertyName("dv_profile")] + public int? DvProfile { get; set; } + + /// + /// Gets or sets the DvLevel. + /// + /// The DvLevel. + [JsonPropertyName("dv_level")] + public int? DvLevel { get; set; } + + /// + /// Gets or sets the RpuPresentFlag. + /// + /// The RpuPresentFlag. + [JsonPropertyName("rpu_present_flag")] + public int? RpuPresentFlag { get; set; } + + /// + /// Gets or sets the ElPresentFlag. + /// + /// The ElPresentFlag. + [JsonPropertyName("el_present_flag")] + public int? ElPresentFlag { get; set; } + + /// + /// Gets or sets the BlPresentFlag. + /// + /// The BlPresentFlag. + [JsonPropertyName("bl_present_flag")] + public int? BlPresentFlag { get; set; } + + /// + /// Gets or sets the DvBlSignalCompatibilityId. + /// + /// The DvBlSignalCompatibilityId. + [JsonPropertyName("dv_bl_signal_compatibility_id")] + public int? DvBlSignalCompatibilityId { get; set; } + } +} diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs index 3f78d0d42c..74d7341e91 100644 --- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs +++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs @@ -841,6 +841,27 @@ namespace MediaBrowser.MediaEncoding.Probing { stream.ColorPrimaries = streamInfo.ColorPrimaries; } + + if (streamInfo.SideDataList != null) + { + foreach (var data in streamInfo.SideDataList) + { + // Parse Dolby Vision metadata from side_data + if (string.Equals(data.SideDataType, "DOVI configuration record", StringComparison.OrdinalIgnoreCase)) + { + stream.DvVersionMajor = data.DvVersionMajor; + stream.DvVersionMinor = data.DvVersionMinor; + stream.DvProfile = data.DvProfile; + stream.DvLevel = data.DvLevel; + stream.RpuPresentFlag = data.RpuPresentFlag; + stream.ElPresentFlag = data.ElPresentFlag; + stream.BlPresentFlag = data.BlPresentFlag; + stream.DvBlSignalCompatibilityId = data.DvBlSignalCompatibilityId; + + break; + } + } + } } else { diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs index 48408e5847..0619a8c087 100644 --- a/MediaBrowser.Model/Entities/MediaStream.cs +++ b/MediaBrowser.Model/Entities/MediaStream.cs @@ -72,6 +72,54 @@ namespace MediaBrowser.Model.Entities /// The color primaries. public string ColorPrimaries { get; set; } + /// + /// Gets or sets the Dolby Vision version major. + /// + /// The Dolby Vision version major. + public int? DvVersionMajor { get; set; } + + /// + /// Gets or sets the Dolby Vision version minor. + /// + /// The Dolby Vision version minor. + public int? DvVersionMinor { get; set; } + + /// + /// Gets or sets the Dolby Vision profile. + /// + /// The Dolby Vision profile. + public int? DvProfile { get; set; } + + /// + /// Gets or sets the Dolby Vision level. + /// + /// The Dolby Vision level. + public int? DvLevel { get; set; } + + /// + /// Gets or sets the Dolby Vision rpu present flag. + /// + /// The Dolby Vision rpu present flag. + public int? RpuPresentFlag { get; set; } + + /// + /// Gets or sets the Dolby Vision el present flag. + /// + /// The Dolby Vision el present flag. + public int? ElPresentFlag { get; set; } + + /// + /// Gets or sets the Dolby Vision bl present flag. + /// + /// The Dolby Vision bl present flag. + public int? BlPresentFlag { get; set; } + + /// + /// Gets or sets the Dolby Vision bl signal compatibility id. + /// + /// The Dolby Vision bl signal compatibility id. + public int? DvBlSignalCompatibilityId { get; set; } + /// /// Gets or sets the comment. ///