MediaBrowser / Emby

Emby Server is a personal media server with apps on just about every device.
https://emby.media
GNU General Public License v2.0
4.17k stars 809 forks source link

Some specific SRT subtitles cannot be displayed on Samsung smart TV #3523

Closed YanzheL closed 5 years ago

YanzheL commented 5 years ago

Description

Example SRT file (Src: House of Cards)

7
00:02:38,890 --> 00:02:41,890
{\pos(196,180)}纸牌屋

8
00:02:38,890 --> 00:02:41,890
{\an2}{\pos(207.5,241.35)}第四季  第一集

9
00:00:06,780 --> 00:00:09,870
梅达把她的手指...
Mayda slides her fingers in...

10
00:00:10,860 --> 00:00:13,930
一直伸进她的婚戒里
all the way up to her... her wedding ring.

11
00:00:14,870 --> 00:00:19,230
她把你推倒  然后倾下身来
She pushes you onto your back and leans down.

12
00:00:20,820 --> 00:00:25,050
把手指伸入你的嘴里  让你尝到
Puts the fingers into your mouth so you can... taste them.

13
00:00:26,470 --> 00:00:28,350
戒指的金味儿
The gold of the ring... 

We can see that this file is not ordered by time, it starts at 00:02:38,890 (Line 7), then back to 00:00:06,780 (Line 9), which causes a problem that there are no subtitles on TV before 00:02:38,890(Line 7). After 00:02:38,890, everything works fine except these subtitles before this time are lost.

This problem doesn't exist on other devices that have emby client, such as browser, PC, smart phones. It only related to direct DLNA devices.

I think the reason is that emby reads the subtitle file line by line, ignoring its time sequence, then streamming to TV. TV finds that the current subtitle time doesn't match current time, so refuse to display it...

So the suggestion is that before streamming to TV, Emby reorder the SRT file content by time, then TV will receive a correctly ordered subtitle.

Emby Version

4.1.0.6 beta

LukePulverenti commented 5 years ago

Curious, why keep the subtitle file out of order? You're kind of asking for trouble there because we feed the subtitles directly to the video player, and if the video player doesn't support this then it will not work.

Your suggest of re-ordering, I suppose that makes sense, but that means we have to start processing user subtitle files now. There is a strong chance that it will just end up creating new problems.

YanzheL commented 5 years ago

These subtitles are downloaded from the internet, some translation team will insert some extra information such as team member info and some ads at the beginning of SRT file. However, the time of this extra info does not start at 00:00, which cause this ordering problem.

I solved this by writing a python script to preprocess these files manually, but I think it would be better if this procedure can be done by Emby.

Maybe this feature can be implemented as an advanced option in subtitle menu? So users are able to choose whether to do the preprocessing.

LukePulverenti commented 5 years ago

For what it's worth, i just tested this in Vlc and i can't even get those subs to show up, and Vlc usually handles everything.

LukePulverenti commented 5 years ago

I'm going to close this as I don't think we'll be adding workarounds for this. Thanks.