aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.MediaEncoding/Probing
diff options
context:
space:
mode:
authorClaus Vium <cvium@users.noreply.github.com>2022-10-07 09:57:16 +0200
committerGitHub <noreply@github.com>2022-10-07 09:57:16 +0200
commit81b04ddbb54201d2e07310e3c700cca8a94d8955 (patch)
treea4e9aeb70e35b3e47a7d8af17b328e88a1c77ed0 /MediaBrowser.MediaEncoding/Probing
parent6bf71c0fd355e9c95a1e142019d9bc5cce34200d (diff)
parent14027f962ce074623fd89967ca9565bbeb785066 (diff)
Merge branch 'master' into providermanager-cleanup
Diffstat (limited to 'MediaBrowser.MediaEncoding/Probing')
-rw-r--r--MediaBrowser.MediaEncoding/Probing/FFProbeHelpers.cs5
-rw-r--r--MediaBrowser.MediaEncoding/Probing/MediaStreamInfo.cs7
-rw-r--r--MediaBrowser.MediaEncoding/Probing/MediaStreamInfoSideData.cs73
-rw-r--r--MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs40
4 files changed, 120 insertions, 5 deletions
diff --git a/MediaBrowser.MediaEncoding/Probing/FFProbeHelpers.cs b/MediaBrowser.MediaEncoding/Probing/FFProbeHelpers.cs
index a9e753726..205e84153 100644
--- a/MediaBrowser.MediaEncoding/Probing/FFProbeHelpers.cs
+++ b/MediaBrowser.MediaEncoding/Probing/FFProbeHelpers.cs
@@ -15,10 +15,7 @@ namespace MediaBrowser.MediaEncoding.Probing
/// <param name="result">The result.</param>
public static void NormalizeFFProbeResult(InternalMediaInfoResult result)
{
- if (result == null)
- {
- throw new ArgumentNullException(nameof(result));
- }
+ ArgumentNullException.ThrowIfNull(result);
if (result.Format?.Tags != null)
{
diff --git a/MediaBrowser.MediaEncoding/Probing/MediaStreamInfo.cs b/MediaBrowser.MediaEncoding/Probing/MediaStreamInfo.cs
index c9c8c34c2..eab8f79bb 100644
--- a/MediaBrowser.MediaEncoding/Probing/MediaStreamInfo.cs
+++ b/MediaBrowser.MediaEncoding/Probing/MediaStreamInfo.cs
@@ -310,5 +310,12 @@ namespace MediaBrowser.MediaEncoding.Probing
/// <value>The color primaries.</value>
[JsonPropertyName("color_primaries")]
public string ColorPrimaries { get; set; }
+
+ /// <summary>
+ /// Gets or sets the side_data_list.
+ /// </summary>
+ /// <value>The side_data_list.</value>
+ [JsonPropertyName("side_data_list")]
+ public IReadOnlyList<MediaStreamInfoSideData> SideDataList { get; set; }
}
}
diff --git a/MediaBrowser.MediaEncoding/Probing/MediaStreamInfoSideData.cs b/MediaBrowser.MediaEncoding/Probing/MediaStreamInfoSideData.cs
new file mode 100644
index 000000000..5dbc438e4
--- /dev/null
+++ b/MediaBrowser.MediaEncoding/Probing/MediaStreamInfoSideData.cs
@@ -0,0 +1,73 @@
+using System.Text.Json.Serialization;
+
+namespace MediaBrowser.MediaEncoding.Probing
+{
+ /// <summary>
+ /// Class MediaStreamInfoSideData.
+ /// </summary>
+ public class MediaStreamInfoSideData
+ {
+ /// <summary>
+ /// Gets or sets the SideDataType.
+ /// </summary>
+ /// <value>The SideDataType.</value>
+ [JsonPropertyName("side_data_type")]
+ public string? SideDataType { get; set; }
+
+ /// <summary>
+ /// Gets or sets the DvVersionMajor.
+ /// </summary>
+ /// <value>The DvVersionMajor.</value>
+ [JsonPropertyName("dv_version_major")]
+ public int? DvVersionMajor { get; set; }
+
+ /// <summary>
+ /// Gets or sets the DvVersionMinor.
+ /// </summary>
+ /// <value>The DvVersionMinor.</value>
+ [JsonPropertyName("dv_version_minor")]
+ public int? DvVersionMinor { get; set; }
+
+ /// <summary>
+ /// Gets or sets the DvProfile.
+ /// </summary>
+ /// <value>The DvProfile.</value>
+ [JsonPropertyName("dv_profile")]
+ public int? DvProfile { get; set; }
+
+ /// <summary>
+ /// Gets or sets the DvLevel.
+ /// </summary>
+ /// <value>The DvLevel.</value>
+ [JsonPropertyName("dv_level")]
+ public int? DvLevel { get; set; }
+
+ /// <summary>
+ /// Gets or sets the RpuPresentFlag.
+ /// </summary>
+ /// <value>The RpuPresentFlag.</value>
+ [JsonPropertyName("rpu_present_flag")]
+ public int? RpuPresentFlag { get; set; }
+
+ /// <summary>
+ /// Gets or sets the ElPresentFlag.
+ /// </summary>
+ /// <value>The ElPresentFlag.</value>
+ [JsonPropertyName("el_present_flag")]
+ public int? ElPresentFlag { get; set; }
+
+ /// <summary>
+ /// Gets or sets the BlPresentFlag.
+ /// </summary>
+ /// <value>The BlPresentFlag.</value>
+ [JsonPropertyName("bl_present_flag")]
+ public int? BlPresentFlag { get; set; }
+
+ /// <summary>
+ /// Gets or sets the DvBlSignalCompatibilityId.
+ /// </summary>
+ /// <value>The DvBlSignalCompatibilityId.</value>
+ [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 3f78d0d42..b33b45ab2 100644
--- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
+++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs
@@ -44,16 +44,28 @@ namespace MediaBrowser.MediaEncoding.Probing
private IReadOnlyList<string> SplitWhitelist => _splitWhiteList ??= new string[]
{
"AC/DC",
+ "A/T/O/S",
"As/Hi Soundworks",
"Au/Ra",
"Bremer/McCoy",
+ "b/bqスタヂオ",
+ "DOV/S",
+ "DJ'TEKINA//SOMETHING",
+ "IX/ON",
+ "J-CORE SLi//CER",
+ "M(a/u)SH",
+ "Kaoru/Brilliance",
+ "signum/ii",
+ "Richiter(LORB/DUGEM DI BARAT)",
"이달의 소녀 1/3",
"R!N / Gemie",
"LOONA 1/3",
"LOONA / yyxy",
"LOONA / ODD EYE CIRCLE",
"K/DA",
- "22/7"
+ "22/7",
+ "諭吉佳作/men",
+ "//dARTH nULL"
};
public MediaInfo GetMediaInfo(InternalMediaInfoResult data, VideoType? videoType, bool isAudio, string path, MediaProtocol protocol)
@@ -841,9 +853,35 @@ 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 if (string.Equals(streamInfo.CodecType, "data", StringComparison.OrdinalIgnoreCase))
+ {
+ stream.Type = MediaStreamType.Data;
}
else
{
+ _logger.LogError("Codec Type {CodecType} unknown. The stream (index: {Index}) will be ignored. Warning: Subsequential streams will have a wrong stream specifier!", streamInfo.CodecType, streamInfo.Index);
return null;
}