Jump to content

Direct Stream Subtitle Delay


Recommended Posts

Posted

Hello,

This post is more of an FYI as I've already resolved the issue by remuxing the affected files but there may still be valuable information to fix a bug in the Android client related to this, and potentially other platforms as well, if root cause is understood.

One of my users reported an issue with the subtitles in one of my shows, specifically when they play it on their Nvidia Shield, that the subtitles would be delayed by 10 seconds. No issues were observed in the web app nor Emby Theater with the file direct playing. I was able to reproduce the issue on my phone as well as my own Shield device, and I have a slightly different observation from my LG TV app but more focused on Android here.

When attempting to play on an Android device I noticed that while the video and audio streams are direct playing it says that it's recovering from a playback error and an ffmpeg-directstream log is created with the reason being simply a direct play error and I can see m4s and vtt segments being requested and delivered to the client. The subtitles are in SRT format and it doesn't matter if you have them enabled or not when playing, this direct play error still occurs so it's not due to the subs specifically, they're just getting affected by it. However, in the case of the LG app it is direct playing, the subtitles are accurate in their presentation, but if you attempt to rewind or fast forward playback will simply stop and return to the item detail screen.

I enabled logging in the Android app and reviewed the log created and the direct play error seems to be due to timecodes in the MKV, which I guess is why remuxing the file fixed the issue, though I don't know what specifically about remuxing the file corrected the issue so that I can look for it in the future as part of my media preparation and ingestion scripts, especially since the web app and Theater had no issues playing it, subs were accurate, FF and rewind worked fine.

  • Android app: 3.4.20
  • LG app: 1.0.43
  • Server: 4.8.8.0
Mon Aug 12 17:02:41 EDT 2024 ExoPlayer onLoadError, wasCanceled true
Mon Aug 12 17:02:41 EDT 2024 internalError [eventTime=0.22, mediaPos=0.00, window=0, period=0, loadError
  androidx.media3.common.ParserException: Can't scale timecode prior to timecodeScale being set.{contentIsMalformed=true, dataType=1}

Mon Aug 12 17:02:41 EDT 2024 playerFailed [eventTime=0.22, mediaPos=0.00, window=0, period=0, errorCode=ERROR_CODE_PARSING_CONTAINER_MALFORMED
  Caused by: androidx.media3.common.ParserException: Can't scale timecode prior to timecodeScale being set.{contentIsMalformed=true, dataType=1}

The below anonymized logs are from a test server that I just spun up with no other media except one of the affected files. I've also attached the log from the android app which I lightly sanitized certain details such as my main server address, any mention of api keys, or my name. In the first attempted playback on my phone it sat at a video player screen making no progress, tapping to show the OSD showed a pause button but tapping that did not change to a play button, I had to back out and try to play it again to get it to play.

I'm happy to provide any further information or testing, I still have one of the original files, just ask!

ffmpeg-directstream-a967a7de-f7a8-4e3e-9970-cbeff70a57e4_1.txtembyserver.txtemby_android_1723496541209.txt

image.png.1078aa4afa76f1a60ef4cd61d41447a0.png

Posted

HI, we'll take a look at it. Thanks.

  • Thanks 1

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...