esmailelbob 1 Posted 1 hour ago Posted 1 hour ago Hello, I have this weird issue where subtitles (most of types) take ages to load and mostly after it fail till like my 3rd or so try. I'm sure it's a player issue since when I used -nompv it used to load all subs instant, and in the web browser it's the same, instant. I'm using transcoding, yes, and my server is on Docker on Debian stable Linux, and my host is Arch Linux. Installed the Emby client via the new beta client repo. Only time it worked fine was when I was NOT transcoding, and the other times it worked were with -nompv or in the web browser. This is my first time reporting a bug here so if I forgot anything please let me know, happy to cooperate and grab whatever logs/info you need. Environment Client: Emby Client Beta 2.321.0 (FullName: Emby Client, X64, Arch Linux) Host OS: Arch Linux (desktop) Server: Emby Server in Docker, on Debian stable Player backend: MPV (the built-in Linux MPV video player plugin) Playback mode: transcoding (HLS, master.m3u8) Subtitle type: external SRT delivered via the subtitle extraction endpoint (embedded track, subtitle stream index 9/10) Steps to reproduce Play a video that needs transcoding (mine hits ContainerBitrateExceedsLimit) Switch to a subtitle track (embedded, srt) Player freezes for several seconds, subtitles either load very late or fail outright with an MPV sub-add error Retry switching the subtitle track a couple times — usually works by attempt 2 or 3 What does NOT reproduce it Same file/subtitle without transcoding — subs load instantly Same server, same file, using -nompv — subs load instantly Same server, same file, in the web browser client — subs load instantly So it really does look isolated to the MPV player path specifically when combined with transcoding. Relevant log excerpts (timestamps and personal info like domain/tokens stripped) First failed attempt — took about 14.7 seconds before failing: >>>> Debug MpvStreamController: SetSubtitleStreamIndex: setSubtitleStreamIndex 9 >>>> Debug MpvStreamController: SetSubtitleStreamIndex: New subtitle stream is external. >>>> Warn MpvVideoPlayer: MpvVideoPlayer.ReportError: [stream] Failed to open <server>/emby/Videos/<id>/<mediasource>/Subtitles/9/0/Stream.srt?api_key=<redacted>. >>>> Warn MpvVideoPlayer: MpvVideoPlayer.ReportError: [cplayer] Can not open external file <server>/emby/Videos/<id>/<mediasource>/Subtitles/9/0/Stream.srt?api_key=<redacted>. >>>> Error JsHostObjectProxy: JsHostObjectProxy.HandleMethodInvokeSync: Exception in PlayerMpvVideo.setSubtitleStreamIndex System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Emby.MpvPlayer.Native.Types.MpvException: MPV error executing command sub-add: error running command Arguments: <server>/emby/Videos/<id>/<mediasource>/Subtitles/9/0/Stream.srt?api_key=<redacted> cached English (SUBRIP) eng at Emby.MpvPlayer.Native.CoreMpvPlayer.CommandV(String[] args) in /_1/src/Players/Emby.MpvPlayer/Native/CoreMpvPlayer.cs:line 343 at Emby.MpvPlayer.Features.StreamControl.MpvStreamController.SetSubtitleStreamIndex(Int32 index) in /_1/src/Players/Emby.MpvPlayer/Features/StreamControl/MpvStreamController.cs:line 186 ... >>>> Warn JsHostObjectProxy: JsHostObjectProxy.HandleMethodInvokeSync: Invocation of PlayerMpvVideo.setSubtitleStreamIndex took 14708 ms Second failed attempt, same track: took about 23.3 seconds: >>>> Debug MpvStreamController: SetSubtitleStreamIndex: setSubtitleStreamIndex 9 >>>> Warn MpvVideoPlayer: MpvVideoPlayer.ReportError: [stream] Failed to open .../Subtitles/9/0/Stream.srt?api_key=<redacted>. >>>> Warn MpvVideoPlayer: MpvVideoPlayer.ReportError: [cplayer] Can not open external file .../Subtitles/9/0/Stream.srt?api_key=<redacted>. >>>> Error JsHostObjectProxy: ... MpvException: MPV error executing command sub-add: error running command >>>> Warn JsHostObjectProxy: JsHostObjectProxy.HandleMethodInvokeSync: Invocation of PlayerMpvVideo.setSubtitleStreamIndex took 23268 ms Third and fourth attempts (same session, different subtitle track index): 6.0s and 4.2s respectively, both with the same sub-add MpvException and "Can not open external file" errors before eventually going through. For comparison — starting the video itself (transcoded HLS) resolves in well under a second every time: >>>> Debug CoreMpvPlayer: LoadFile [...]: LoadFile <server>/emby/videos/<id>/master.m3u8?... >>>> Debug CoreMpvPlayer: Play [...]: Play >>>> Info JsHostObjectProxy: ... Async method return: PlayerMpvVideo.play So video load is fast and consistent; only the external subtitle fetch via MPV's sub-add is slow/erratic, and the delay is different every time (14.7s, 23.3s, 6.0s, 4.2s) rather than a fixed timeout, which points to it being a real (variable) fetch/extraction delay rather than something hardcoded. Additional notes The subtitle URL pattern is /emby/Videos/{itemId}/{mediaSourceId}/Subtitles/{index}/0/Stream.srt — this looks like an on-demand extraction/conversion endpoint rather than serving a static file, which might explain the variable timing. Happy to grab full server-side logs, ffmpeg subtitle extraction timing, or run a direct curl timing test against the subtitle endpoint if that'd help narrow it down — just let me know what's useful.
Luke 43038 Posted 1 hour ago Posted 1 hour ago Hi there, let's look at an example. Please attach the information requested in how to report a media playback issue. Thanks!
esmailelbob 1 Posted 38 minutes ago Author Posted 38 minutes ago (edited) Hi, thanks for taking time to reply and yea sure Attached the ffmpeg transcode log and server log covering this. Let me know if you need anything else. ffmpeg-transcode-db45ce41_clean.txt embyserver_clean.txt Edited 34 minutes ago by esmailelbob
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now