FAQ  •  Register  •  Login

Problem with subtitles

<<

raynbow

Serviio newbie

Posts: 1

Joined: Mon Sep 28, 2020 7:39 pm

Post Mon Sep 28, 2020 7:44 pm

Problem with subtitles

Hello!
I try to watch anime with subtitles on my LG Smart TV, but the subtitles shows up in this way https://imgur.com/B656DAc . I think the problem is that the TV does not recognize the font style. Is it possible to fix this issue?
<<

atc98092

User avatar

DLNA master

Posts: 5205

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Mon Sep 28, 2020 8:29 pm

Re: Problem with subtitles

Just a guess on my part, but I don't think Serviio has any control over subtitle format. I see a setting for burned-in subs to set a font face, but nothing else. If the subs are embedded in the media file, the font is being specified within it.
Dan

LG NANO85 4K TV, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku Ultra, Premiere and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: Intel i5-6400, 16 gig ram, Windows 10 Pro, 22 TB hard drive space | Test server Windows 10 Pro, AMD Phenom II X4 965, 8 gig ram

HOWTO: Enable debug logging HOWTO: Identify media file contents
<<

Kagami

Serviio newbie

Posts: 2

Joined: Mon May 08, 2023 11:50 pm

Post Tue May 09, 2023 12:01 am

Re: Problem with subtitles

The problem is caused by FFmpeg’s srt encoder: it tries to preserve styles of the ASS subtitle format and in particular uses <font> tag to specify same font that was used in ASS styles.

Media player in LG Smart TV, at least the one I have, doesn’t support those font tags in SRT subtitles, so it renders them just as a plain text.

I enabled debug logging for Serviio and here is the command it uses to convert ASS to SRT:
  Code:
DEBUG [ProcessExecutor] Starting ffmpeg -sub_charenc ISO-8859-1 -i /media/serviio/subtitle.ass -an -vn -c:s srt -f srt pipe:

To reproduce, try the following: save this to 1.ass
  Code:
[Script Info]

[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: Default,Liberation Sans,50,&H00FFFFFF,&H000000FF,&H56000000,&H00000000,-1,0,0,0,100,100,0,0,1,2,0,2,10,10,20,1

[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:00:11.78,0:00:13.26,Default,,0,0,0,,Test

Run this:
  Code:
ffmpeg -i 1.ass -c:s srt 1.srt

The result is:
  Code:
1
00:00:11,780 --> 00:00:13,260
<font face="Liberation Sans" size="50"><b>Test</b></font>

Now, the solution is simple. Just use text encoder to produce tag-less SRT file:
  Code:
ffmpeg -i 1.ass -c:s text 2.srt

The result is:
  Code:
1
00:00:11,780 --> 00:00:13,260
Test

So, @zip, could you please add an option to Serviio, to pass -c:s text to FFmpeg instead of -c:s srt?
<<

Kagami

Serviio newbie

Posts: 2

Joined: Mon May 08, 2023 11:50 pm

Post Tue May 09, 2023 10:33 am

Re: Problem with subtitles

I found another way. My LG Smart TV actually supports external ASS subtitles.

So you can just change in Generic DLNA profile:
  Code:
-                       <SoftSubs mime-type="text/srt" type="srt" character-encoding="utf-8" />
+                       <SoftSubs mime-type="text/ass" type="ass" character-encoding="utf-8" />

That way Serviio will convert all subtitle formats to ASS and it works fine because all features of SRT are supported in ASS.
But this requires update to the Profiles.xsd schema.

Not sure what's the best way to handle this, needs additional testing. There are 3 options:
  • Convert ASS to SRT with text encoder, serve SRT as is
  • Convert SRT to ASS, serve ASS as is
  • Serve both SRT and ASS as is

Return to LG

Who is online

Users browsing this forum: No registered users and 10 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.