Merge pull request #17419 from rwebster85/mp4-audio-subtitle-names

Check the "name" tag for audio/subtitle probe to fix MP4 not showing correctly - Fixes issue #17418
This commit is contained in:
Cody Robibero
2026-07-24 21:30:54 -04:00
committed by GitHub
4 changed files with 26 additions and 11 deletions
+1
View File
@@ -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
@@ -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))
// FFprobe exposes MP4 track names via the name tag rather than title
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))
// FFprobe exposes MP4 track names via the name tag rather than title
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;
}
}
}
}
@@ -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);
@@ -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"
}
},
{