From 474ae50c367959baa3e15f18b894fd8a2872c634 Mon Sep 17 00:00:00 2001 From: Richard Webster <16655270+rwebster85@users.noreply.github.com> Date: Wed, 22 Jul 2026 18:00:18 +0100 Subject: [PATCH 1/4] Check the "name" tag, not just "title" --- .../Probing/ProbeResultNormalizer.cs | 28 +++++++++++++------ .../Probing/ProbeResultNormalizerTests.cs | 2 +- .../Test Data/Probing/video_mp4_metadata.json | 6 ++-- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs index 989701350c..8c5b0e610e 100644 --- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs +++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs @@ -757,11 +757,17 @@ namespace MediaBrowser.MediaEncoding.Probing if (string.IsNullOrEmpty(stream.Title)) { - // mp4 missing track title workaround: fall back to handler_name if populated and not the default "SoundHandler" - string handlerName = GetDictionaryValue(streamInfo.Tags, "handler_name"); - if (!string.IsNullOrEmpty(handlerName) && !string.Equals(handlerName, "SoundHandler", StringComparison.OrdinalIgnoreCase)) + // mp4 missing track title workaround: some muxers store the track title in a "name" tag + stream.Title = GetDictionaryValue(streamInfo.Tags, "name"); + + if (string.IsNullOrEmpty(stream.Title)) { - stream.Title = handlerName; + // fall back to handler_name if populated and not the default "SoundHandler" + string handlerName = GetDictionaryValue(streamInfo.Tags, "handler_name"); + if (!string.IsNullOrEmpty(handlerName) && !string.Equals(handlerName, "SoundHandler", StringComparison.OrdinalIgnoreCase)) + { + stream.Title = handlerName; + } } } } @@ -781,11 +787,17 @@ namespace MediaBrowser.MediaEncoding.Probing if (string.IsNullOrEmpty(stream.Title)) { - // mp4 missing track title workaround: fall back to handler_name if populated and not the default "SubtitleHandler" - string handlerName = GetDictionaryValue(streamInfo.Tags, "handler_name"); - if (!string.IsNullOrEmpty(handlerName) && !string.Equals(handlerName, "SubtitleHandler", StringComparison.OrdinalIgnoreCase)) + // mp4 missing track title workaround: some muxers store the track title in a "name" tag + stream.Title = GetDictionaryValue(streamInfo.Tags, "name"); + + if (string.IsNullOrEmpty(stream.Title)) { - stream.Title = handlerName; + // fall back to handler_name if populated and not the default "SubtitleHandler" + string handlerName = GetDictionaryValue(streamInfo.Tags, "handler_name"); + if (!string.IsNullOrEmpty(handlerName) && !string.Equals(handlerName, "SubtitleHandler", StringComparison.OrdinalIgnoreCase)) + { + stream.Title = handlerName; + } } } } diff --git a/tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs b/tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs index b723fc7208..52e0b19700 100644 --- a/tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs +++ b/tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs @@ -219,7 +219,7 @@ namespace Jellyfin.MediaEncoding.Tests.Probing Assert.Equal("eng", res.MediaStreams[4].Language); Assert.Equal(MediaStreamType.Subtitle, res.MediaStreams[4].Type); Assert.Equal("mov_text", res.MediaStreams[4].Codec); - Assert.Null(res.MediaStreams[4].Title); + Assert.Equal("SDH", res.MediaStreams[4].Title); Assert.True(res.MediaStreams[4].IsHearingImpaired); Assert.Equal("eng", res.MediaStreams[5].Language); diff --git a/tests/Jellyfin.MediaEncoding.Tests/Test Data/Probing/video_mp4_metadata.json b/tests/Jellyfin.MediaEncoding.Tests/Test Data/Probing/video_mp4_metadata.json index 9a7a4ba373..e406cc18b0 100644 --- a/tests/Jellyfin.MediaEncoding.Tests/Test Data/Probing/video_mp4_metadata.json +++ b/tests/Jellyfin.MediaEncoding.Tests/Test Data/Probing/video_mp4_metadata.json @@ -95,7 +95,8 @@ "tags": { "creation_time": "2021-09-13T22:42:42.000000Z", "language": "eng", - "handler_name": "Surround 6.1", + "handler_name": "SoundHandler", + "name": "Surround 6.1", "vendor_id": "[0][0][0][0]" } }, @@ -215,7 +216,8 @@ "tags": { "creation_time": "2021-09-13T22:42:42.000000Z", "language": "eng", - "handler_name": "SubtitleHandler" + "handler_name": "SubtitleHandler", + "name": "SDH" } }, { From 3d4c52092e9d78efab2f55ffe4da4d081a86c6aa Mon Sep 17 00:00:00 2001 From: Richard Webster <16655270+rwebster85@users.noreply.github.com> Date: Thu, 23 Jul 2026 10:13:04 +0100 Subject: [PATCH 2/4] Clarify comment about MP4 track title workaround --- MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs index 8c5b0e610e..5f0c76c1b7 100644 --- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs +++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs @@ -757,7 +757,7 @@ namespace MediaBrowser.MediaEncoding.Probing if (string.IsNullOrEmpty(stream.Title)) { - // mp4 missing track title workaround: some muxers store the track title in a "name" tag + // mp4 missing track title workaround: FFprobe exposes MP4 track names via the name tag rather than title stream.Title = GetDictionaryValue(streamInfo.Tags, "name"); if (string.IsNullOrEmpty(stream.Title)) @@ -787,7 +787,7 @@ namespace MediaBrowser.MediaEncoding.Probing if (string.IsNullOrEmpty(stream.Title)) { - // mp4 missing track title workaround: some muxers store the track title in a "name" tag + // mp4 missing track title workaround: FFprobe exposes MP4 track names via the name tag rather than title stream.Title = GetDictionaryValue(streamInfo.Tags, "name"); if (string.IsNullOrEmpty(stream.Title)) From ca0cf763ffd4bbedd330247bdb3f05bea3d757ca Mon Sep 17 00:00:00 2001 From: Richard Webster <16655270+rwebster85@users.noreply.github.com> Date: Thu, 23 Jul 2026 11:57:34 +0100 Subject: [PATCH 3/4] Update comment --- MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs index 5f0c76c1b7..b6acfdbf3b 100644 --- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs +++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs @@ -757,7 +757,7 @@ namespace MediaBrowser.MediaEncoding.Probing if (string.IsNullOrEmpty(stream.Title)) { - // mp4 missing track title workaround: FFprobe exposes MP4 track names via the name tag rather than title + // FFprobe exposes MP4 track names via the name tag rather than title stream.Title = GetDictionaryValue(streamInfo.Tags, "name"); if (string.IsNullOrEmpty(stream.Title)) @@ -787,7 +787,7 @@ namespace MediaBrowser.MediaEncoding.Probing if (string.IsNullOrEmpty(stream.Title)) { - // mp4 missing track title workaround: FFprobe exposes MP4 track names via the name tag rather than title + // FFprobe exposes MP4 track names via the name tag rather than title stream.Title = GetDictionaryValue(streamInfo.Tags, "name"); if (string.IsNullOrEmpty(stream.Title)) From 70980f09de58533871887c73859baaee09e5a318 Mon Sep 17 00:00:00 2001 From: Richard Webster <16655270+rwebster85@users.noreply.github.com> Date: Thu, 23 Jul 2026 11:59:43 +0100 Subject: [PATCH 4/4] Update contributors --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 4e323e332a..0df74c2bc3 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -233,6 +233,7 @@ - [MSalman5230](https://github.com/MSalman5230) - [dwandw](https://github.com/dwandw) - [Lampan-git](https://github.com/Lampan-git) + - [rwebster85](https://github.com/rwebster85) # Emby Contributors