Jump to content

LG App 1.0.37 & 1.0.39 - Embedded subtitles did not work


anthony199206
Go to solution Solved by anthony199206,

Recommended Posts

anthony199206

Hi guys! Long time user, first post :)

I have two different LG TVs, one of them is an LG 49UK6300 that connects remotely, while the other one is a 49SM8600, which is a local client. During the last few weeks, I had an issue that subtitles do not work in case it is an embedded one and not an external file. I had issues before on LG TVs when watching something with embedded subtitles, and usually, the workaround was to simply transcode instead of direct play, and then it worked. But now, it does not matter whether it is direct play or transcoded, subtitles don't show on either of those TVs. Initially, both of them had the 1.0.37 app installed, but yesterday I updated the local one to 1.0.39 and the same issue is still present. I even tried using the built-in browser to check what happens there, but it is the same outcome as using the app. The subtitles work perfectly when I watch the same video on other clients (both locally, and remotely: Android app, AndroidTV app, Chrome, Emby Theater).

Server version: 4.7.13.0 (using the emby/emby docker image)
Subtitle extraction and HW accelerated transcoding are enabled on the server.

There is no issue with external subtitles, those are showing up and working perfectly on both of these TVs.

The transcoding log is attached, as well as a picture of the Media Info section, but I cannot attach any kind of logs for direct play.

image.thumb.png.8b52f35c168bd85e35836165c5a8fb87.png
image.thumb.png.b2cd3cced48d28cf9eb8d9831d12b178.png

Thank you :)

ffmpeg-transcode-a0b03e82-6343-4eb4-9c57-1a3596a72936_1.txt

Edited by anthony199206
typo
Link to comment
Share on other sites

anthony199206

Hi Luke, thanks, I forgot to attach the server log, so I did the following now:

1. Server restart
2. Start a movie on LG TV (with transcoding): no subtitles
3. After ~1 min playtime switched to direct play: still no subtitles
4. Starting the same movie on my PC (Google Chrome): subtitles working perfectly

(FYI: Playing the movie on PC caused a remux because of the audio codec, so I attached the remux log too).

I looked into the attached log and it's interesting that when I started playback (and when I switched to direct play) on the TV, it threw an error on "subtitle extraction" in both cases, but I don't see the error when I started the same movie on the PC.

Thank you for looking into this.

embyserver.txt ffmpeg-remux-adac2aa6-81a4-40af-8617-ef0526c8dee9_1.txt ffmpeg-transcode-23985753-cd34-429a-8280-f651a65bed5e_1.txt

Link to comment
Share on other sites

@anthony199206can you try removing the HEVC Transcode Killer plugin, then restart the server and try again? Please let us know if this resolves the issue. Thanks !

Link to comment
Share on other sites

anthony199206

@LukeSo, I removed the plugin and restarted the server, but unfortunately, it is the same scenario as before.

But... This time I checked once again, and while I have subtitles using Chrome & Android mobile/Android TV apps, the subtitles do not show up using the Emby Theater app. So, I have just tested on 2 clients at the same time, I can see on the dashboard, that both my phone and the Emby Theater app does direct play, and still, subtitles only show up on the mobile client. The log has the same error message in the case of the Theater app, then what I get when I direct play/transcode on the LG tv:

Spoiler

Runtime: system/System.Private.CoreLib.dll

Processor count: 2

Data path: /config

Application path: /system

System.TimeoutException: System.TimeoutException: Operation timed out after 600000ms

at Emby.Server.MediaEncoding.Subtitles.SubtitleEncoder.ExtractTextSubtitleInternal(String inputPath, Boolean isAudio, String inputSubtitleCodec, MediaStream subtitleStream, SubtitleMediaTypes outputCodec, String outputPath, Nullable`1 startTime, Nullable`1 endTime, Boolean preserveOriginalTimestamps, CancellationToken cancellationToken)

Source: Emby.Server.MediaEncoding

TargetSite: Void MoveNext()

2023-08-18 15:10:31.148 Error App: Error getting subtitles

*** Error Report ***

Version: 4.7.13.0

Command line: /system/EmbyServer.dll -programdata /config -ffdetect /bin/ffdetect -ffmpeg /bin/ffmpeg -ffprobe /bin/ffprobe -restartexitcode 3

Operating system: Linux version 5.19.17-2-pve (build@proxmox) (gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1 SMP PREEMPT_DYNAMIC PV

Framework: .NET 6.0.14

OS/Process: x64/x64

Runtime: system/System.Private.CoreLib.dll

Processor count: 2

Data path: /config

Application path: /system

System.TimeoutException: System.TimeoutException: Operation timed out after 600000ms

at Emby.Server.MediaEncoding.Subtitles.SubtitleEncoder.ExtractTextSubtitleInternal(String inputPath, Boolean isAudio, String inputSubtitleCodec, MediaStream subtitleStream, SubtitleMediaTypes outputCodec, String outputPath, Nullable`1 startTime, Nullable`1 endTime, Boolean preserveOriginalTimestamps, CancellationToken cancellationToken)

at Emby.Server.MediaEncoding.Subtitles.SubtitleEncoder.ExtractTextSubtitle(ReadOnlyMemory`1 inputPath, Boolean isAudio, String inputSubtitleCodec, MediaProtocol protocol, MediaStream subtitleStream, SubtitleMediaTypes outputCodec, String outputPath, Nullable`1 startTime, Nullable`1 endTime, Boolean preserveOriginalTimestamps, CancellationToken cancellationToken)

at Emby.Server.MediaEncoding.Subtitles.SubtitleEncoder.GetReadableFile(String mediaPath, MediaProtocol mediaSourceProtocol, Boolean isAudio, IDictionary`2 requestHeaders, MediaStream subtitleStream, String outputFormat, Int64 startTimeTicks, Int64 endTimeTicks, Boolean preserveOriginalTimestamps, EncodingContext encodingContext, CancellationToken cancellationToken)

at Emby.Server.MediaEncoding.Subtitles.SubtitleEncoder.GetSubtitles(String inputPath, MediaProtocol inputProtocol, Boolean isAudio, IDictionary`2 requestHeaders, MediaStream subtitleStream, String outputFormat, Int64 startTimeTicks, Int64 endTimeTicks, Boolean preserveOriginalTimestamps, EncodingContext encodingContext, CancellationToken cancellationToken)

at Emby.Api.Subtitles.SubtitleService.GetSubtitles(GetSubtitle request, CancellationToken cancellationToken)

at Emby.Api.Subtitles.SubtitleService.Get(GetSubtitle request)

Source: Emby.Server.MediaEncoding

TargetSite: Void MoveNext()

Based on the fact, that the same issue happens using the Emby Theater app, I guess it is not really an issue with the LG App, but instead something on the server side. I'm attaching the whole server log. I still use the same file, just for consistency, but I get the same result with every other file that has embedded subtitles.

Thanks.

embyserver (1).txt

Edited by anthony199206
Added some additional info
Link to comment
Share on other sites

  • 2 weeks later...

@anthony199206

You're playing from the Emby LG app, and the LG video player does not support embedded subtitles. Therefore we have to extract the subtitles from the video on the fly and send them down to the player to render. 

In your environment, this takes too long and that's why you're not seeing subtitles:

Can you try using external subtitles instead? Those will be much more efficient.

Link to comment
Share on other sites

anthony199206

 Hi Luke, thank you for the explanation.

A few weeks ago I bought a NAS, and moved my media collection there, while Emby is running within a VM (via docker) on another machine running Proxmox (using a dedicated GPU for transcoding). Based on the message above, the issue's root cause could be that I have just a 1 gig connection between those machines, right? Before the move, I used mergerFS on OMV, and sequential reading was not that much faster than what I have now with a gigabit connection. I have subtitle extraction turned on since it was announced first, and everything was working perfectly a few months ago. Was there any change on the LG video player, that prevents working with embedded subtitles now?

I did some tests, and it looks like the only bottleneck I can identify is the 1 gig link. I did some tests within the Emby container, to simulate subtitle extraction using the following command (copied for the logs):

/bin/ffmpeg -loglevel +timing -y -i "file:/test/Cruella (2021)/Cruella.2021.1080p.BluRay.DDP7.1.x264.HUN-PTHD.mkv" -map 0:6 -vn -an -c:s:0 webvtt "./e19535e9b01e4a469f7ef5fcb64e9a7e.vtt"

I did all of the tests within the /tmp directory, which is a bind-mounted directory on an SSD, just to eliminate any potential issues.

Test result using NFS mount and 2 virtual CPU cores:

Spoiler

nfs-mount-2-vcpu.thumb.png.c7f73ae7cd486fb893f8d614544773ae.png

The result using the same NFS mount with 8 virtual CPU cores:

Spoiler

nfs-mount-8-vcpu.thumb.png.49234fc9de1a24050346f1ddd13783b2.png

As you can see, there was basically no difference between running the VM with 2 or 8 vCPUs. After that, I spun up Docker & Emby with the same configuration on the original machine that I used before migrating my media to the NAS. Did the same test, using bind-mounts instead of NFS, and running Emby on the same machine as the media:

Spoiler

bind-mount.thumb.png.165511838ee5822d681499abb5fedd76.png

So even without a network bottleneck, I am still not able to extract the subtitles in time, since based on the log, the server states the process timed out after ~30 seconds.

I know that external subtitles are much better for performance, but I already have ~1k movies and ~5k TV episodes on my NAS, while most of them have embedded subtitles because those do not exist on the internet (at least in my language). Since English is not my native language, and my family does not speak English, we are using a ton of subtitles.

I would prefer not to transcode, just to have subtitles. This same setup worked for many years, but right now it looks like I need at least a 5Gb/s connection (just for FHD movies, not even talking about 4K) between the server and the NAS to be able to watch the movies on the LG TVs without turning off subtitle extraction? At the moment, even if I force transcoding on the TV, the subtitles are still not working. Is this 30-second limit a bug or is something wrong with my setup? The log file says that it timed out after 600000ms (= 600 sec = 5 minutes), while in reality, most of the time it is just 30 seconds.

Spoiler

From the log, subtitle extraction starts at 17:51:34:

2023-08-30 17:51:34.321 Info SubtitleEncoder: ProcessRun 'ffmpeg-subtitle_extract' Execute: /bin/ffmpeg -loglevel +timing -y -i "file:/movies/Cruella (2021)/Cruella.2021.1080p.BluRay.DDP7.1.x264.HUN-PTHD.mkv" -map 0:6 -vn -an -c:s:0 webvtt "/config/cache/temp/35e092edb3de4436a9698decdd06938d.vtt"

After 30 seconds, it is timed out:

2023-08-30 17:52:04.092 Error SubtitleEncoder: Error running ffmpeg-subtitle_extract -loglevel +timing -y -i "file:/movies/Cruella (2021)/Cruella.2021.1080p.BluRay.DDP7.1.x264.HUN-PTHD.mkv" -map 0:6 -vn -an -c:s:0 webvtt "/config/cache/temp/35e092edb3de4436a9698decdd06938d.vtt"
	*** Error Report ***
	Version: 4.7.14.0
	Command line: /system/EmbyServer.dll -programdata /config -ffdetect /bin/ffdetect -ffmpeg /bin/ffmpeg -ffprobe /bin/ffprobe -restartexitcode 3
	Operating system: Linux version 6.1.0-11-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT
	Framework: .NET 6.0.20
	OS/Process: x64/x64
	Runtime: system/System.Private.CoreLib.dll
	Processor count: 2
	Data path: /config
	Application path: /system
	System.TimeoutException: System.TimeoutException: Operation timed out after 600000ms
	   at Emby.Server.MediaEncoding.Subtitles.SubtitleEncoder.ExtractTextSubtitleInternal(String inputPath, Boolean isAudio, String inputSubtitleCodec, MediaStream subtitleStream, SubtitleMediaTypes outputCodec, String outputPath, Nullable`1 startTime, Nullable`1 endTime, Boolean preserveOriginalTimestamps, CancellationToken cancellationToken)
	Source: Emby.Server.MediaEncoding
	TargetSite: Void MoveNext()
	
2023-08-30 17:52:04.100 Error App: Error getting subtitles
	*** Error Report ***
	Version: 4.7.14.0
	Command line: /system/EmbyServer.dll -programdata /config -ffdetect /bin/ffdetect -ffmpeg /bin/ffmpeg -ffprobe /bin/ffprobe -restartexitcode 3
	Operating system: Linux version 6.1.0-11-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT
	Framework: .NET 6.0.20
	OS/Process: x64/x64
	Runtime: system/System.Private.CoreLib.dll
	Processor count: 2
	Data path: /config
	Application path: /system
	System.TimeoutException: System.TimeoutException: Operation timed out after 600000ms
	   at Emby.Server.MediaEncoding.Subtitles.SubtitleEncoder.ExtractTextSubtitleInternal(String inputPath, Boolean isAudio, String inputSubtitleCodec, MediaStream subtitleStream, SubtitleMediaTypes outputCodec, String outputPath, Nullable`1 startTime, Nullable`1 endTime, Boolean preserveOriginalTimestamps, CancellationToken cancellationToken)
	   at Emby.Server.MediaEncoding.Subtitles.SubtitleEncoder.ExtractTextSubtitle(ReadOnlyMemory`1 inputPath, Boolean isAudio, String inputSubtitleCodec, MediaProtocol protocol, MediaStream subtitleStream, SubtitleMediaTypes outputCodec, String outputPath, Nullable`1 startTime, Nullable`1 endTime, Boolean preserveOriginalTimestamps, CancellationToken cancellationToken)
	   at Emby.Server.MediaEncoding.Subtitles.SubtitleEncoder.GetReadableFile(String mediaPath, MediaProtocol mediaSourceProtocol, Boolean isAudio, IDictionary`2 requestHeaders, MediaStream subtitleStream, String outputFormat, Int64 startTimeTicks, Int64 endTimeTicks, Boolean preserveOriginalTimestamps, EncodingContext encodingContext, CancellationToken cancellationToken)
	   at Emby.Server.MediaEncoding.Subtitles.SubtitleEncoder.GetSubtitles(String inputPath, MediaProtocol inputProtocol, Boolean isAudio, IDictionary`2 requestHeaders, MediaStream subtitleStream, String outputFormat, Int64 startTimeTicks, Int64 endTimeTicks, Boolean preserveOriginalTimestamps, EncodingContext encodingContext, CancellationToken cancellationToken)
	   at Emby.Api.Subtitles.SubtitleService.GetSubtitles(GetSubtitle request, CancellationToken cancellationToken)
	   at Emby.Api.Subtitles.SubtitleService.Get(GetSubtitle request)
	Source: Emby.Server.MediaEncoding
	TargetSite: Void MoveNext()

Thank you for your help so far Luke, I really appreciate it.

Link to comment
Share on other sites

@anthony199206the subtitle extraction process has to step through the entire video. Usually it's more disk I/O performance that is the bottleneck rather than CPU or network bandwidth. By disk I mean the disk that the media is on.

Truthfully I think your best bet is external subtitles, which our subtitle download features can help with.

Link to comment
Share on other sites

  • Solution
anthony199206

Hi @Luke sorry for the late response, I have not had much time in the last few days.

I did some additional tests today, and I have the root cause of the issue. I am really sorry for your time, this was an issue on my side. To be more specific, I am using a docker swarm cluster, and some weeks ago, I changed my stack from using multiple reverse proxies to a load balancer with Virtual IP and 1 reverse proxy. Within the HAProxy configuration, I used some of the recommended settings from the HAProxy documentation, so I had a 30s timeout configured for the client and server time too. I guess, the client sends a request for the given subtitle, and the response will be returned synchronously when the extraction is finished, which means the server response time exceeds the configured 30s timeout and HAProxy kills the connection. Changing the server-side timeout to 10 minutes (based on the log, this is the configured timeout for the subtitle extraction job within Emby) solved the issue, the extraction now works as expected, and within 1 to 2 minutes the subtitle extraction finishes and the subtitle will be delivered to the client app (and cached). Already told my clients that they have to multiply the size of the movie by 10 and they get an approximate time in seconds needed for the subtitles to show up. In the meantime, I will look into an automated solution to extract subtitles from my media collection in an effective way (sadly, most of the automated solutions only do 1 track at a time).

Tl;dr: In case you are using a reverse proxy/load balancer, make sure that the server-side timeout is configured in a way that Emby has enough time to extract the subtitle. My recommendation is to set it to 10 minutes.

Since Emby is already able to do subtitle extraction, would it be possible in a future release, to do something like this as an automated job? Like for example the chapter extraction or the intro detection. Would be a really cool feature for some of us, who speak unpopular foreign languages, which means external subtitles are not always accessible to us.

Edited by anthony199206
Added tldr one-liner
Link to comment
Share on other sites

Thanks for the feedback.

Quote

Since Emby is already able to do subtitle extraction, would it be possible in a future release, to do something like this as an automated job? Like for example the chapter extraction or the intro detection

It is possible, but usually I end up feeling like the time is better invested on new ways of playing that don't require the extraction in the first place. It's just unfortunate that on some devices such as LG, those newer techniques can't always be used.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...