diff options
| author | Bond-009 <bond.009@outlook.com> | 2024-08-27 22:24:34 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-27 22:24:34 +0200 |
| commit | 6281cd707dae40a26c419c0069fd22f494d50f7f (patch) | |
| tree | 84d4a49bc42b993ff2ed88f39736f8b08fb44719 /MediaBrowser.MediaEncoding | |
| parent | ed572467aab96d6149c85dc0d0b406bc6c5106e2 (diff) | |
| parent | d4472074896a8ed3f66a6eb2c7cd438b97787ae4 (diff) | |
Merge pull request #11250 from nyanmisaka/fix-hwa-video-rotation
Fix the broken video orientation (+-90/180)
Diffstat (limited to 'MediaBrowser.MediaEncoding')
3 files changed, 20 insertions, 2 deletions
diff --git a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs index 20a47da10..6c43be3ab 100644 --- a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs +++ b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs @@ -112,25 +112,31 @@ namespace MediaBrowser.MediaEncoding.Encoder "yadif_cuda", "tonemap_cuda", "overlay_cuda", + "transpose_cuda", "hwupload_cuda", // opencl "scale_opencl", "tonemap_opencl", "overlay_opencl", + "transpose_opencl", // vaapi "scale_vaapi", "deinterlace_vaapi", "tonemap_vaapi", "procamp_vaapi", "overlay_vaapi", + "transpose_vaapi", "hwupload_vaapi", // vulkan "libplacebo", "scale_vulkan", "overlay_vulkan", + "transpose_vulkan", + "flip_vulkan", // videotoolbox "yadif_videotoolbox", "scale_vt", + "transpose_vt", "overlay_videotoolbox", "tonemap_videotoolbox", // rkrga @@ -146,7 +152,8 @@ namespace MediaBrowser.MediaEncoding.Encoder { 2, new string[] { "tonemap_opencl", "bt2390" } }, { 3, new string[] { "overlay_opencl", "Action to take when encountering EOF from secondary input" } }, { 4, new string[] { "overlay_vaapi", "Action to take when encountering EOF from secondary input" } }, - { 5, new string[] { "overlay_vulkan", "Action to take when encountering EOF from secondary input" } } + { 5, new string[] { "overlay_vulkan", "Action to take when encountering EOF from secondary input" } }, + { 6, new string[] { "transpose_opencl", "rotate by half-turn" } } }; // These are the library versions that corresponds to our minimum ffmpeg version 4.4 according to the version table below diff --git a/MediaBrowser.MediaEncoding/Probing/MediaStreamInfoSideData.cs b/MediaBrowser.MediaEncoding/Probing/MediaStreamInfoSideData.cs index 5dbc438e4..0b5dd1d1b 100644 --- a/MediaBrowser.MediaEncoding/Probing/MediaStreamInfoSideData.cs +++ b/MediaBrowser.MediaEncoding/Probing/MediaStreamInfoSideData.cs @@ -69,5 +69,12 @@ namespace MediaBrowser.MediaEncoding.Probing /// <value>The DvBlSignalCompatibilityId.</value> [JsonPropertyName("dv_bl_signal_compatibility_id")] public int? DvBlSignalCompatibilityId { get; set; } + + /// <summary> + /// Gets or sets the Rotation in degrees. + /// </summary> + /// <value>The Rotation.</value> + [JsonPropertyName("rotation")] + public int? Rotation { get; set; } } } diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs index 5a5eb6e61..334796f58 100644 --- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs +++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs @@ -892,8 +892,12 @@ namespace MediaBrowser.MediaEncoding.Probing stream.ElPresentFlag = data.ElPresentFlag; stream.BlPresentFlag = data.BlPresentFlag; stream.DvBlSignalCompatibilityId = data.DvBlSignalCompatibilityId; + } - break; + // Parse video rotation metadata from side_data + else if (string.Equals(data.SideDataType, "Display Matrix", StringComparison.OrdinalIgnoreCase)) + { + stream.Rotation = data.Rotation; } } } |
