Exoplayer crashes on some high bitrate H264 4K content

Server Version#: 1.23.5.4841
Player Version#: 8.20.1.26670 (caf51fef)

Hi,

I have an issue where Plex is crashing (usually restarts mid-playback) when playing high bitrate (~100Mbit/sec) H264 4K 30p files. It happens on all android devices, which includes my Nvidia Shield, Sansung Tab S7+, Samsung z flip phone etc. It will always occur at a certain frame in the content, across multiple files but not all files. From the debug log it looks like it’s Exoplayer crashing :

7-22 16:47:15.690 e: [ExoPlayer][EventLogger] playerFailed [eventTime=45.41, mediaPos=490.80, window=0, period=0
com.google.android.exoplayer2.ExoPlaybackException: Unexpected runtime error
at com.google.android.exoplayer2.o0.handleMessage(SourceFile:29)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:246)
at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: java.lang.IndexOutOfBoundsException: off=0, len=65536 out of bounds (size=-716123760)
at java.nio.Buffer.checkBounds(Buffer.java:587)
at java.nio.DirectByteBuffer.put(DirectByteBuffer.java:292)
at com.google.android.exoplayer2.source.k0.h(SourceFile:4)
at com.google.android.exoplayer2.source.k0.k(SourceFile:18)
at com.google.android.exoplayer2.source.k0.l(SourceFile:1)
at com.google.android.exoplayer2.source.l0.R(SourceFile:4)
at com.plexapp.plex.ff.source.FFMediaPeriod.readData(SourceFile:2)
at com.plexapp.plex.ff.source.FFSampleStream.readData(SourceFile:1)
at com.google.android.exoplayer2.f0.readSource(SourceFile:1)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.feedInputBuffer(SourceFile:25)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(SourceFile:18)
at com.google.android.exoplayer2.o0.o(SourceFile:14)
at com.google.android.exoplayer2.o0.handleMessage(SourceFile:25)
… 3 more
]
07-22 16:47:15.690 i: [FFmpeg] [INFO] Demuxer has been successfully interupted.
07-22 16:47:15.691 i: [FFmpeg] [INFO] Demuxer closing.

Any assistance greatly appreciated.

Can you share a sample? I’m curious if it’s a malformed stream.

The files are rendered from Davinci Resolve 17 using the Nvidia renderer. The problem is that the problem can occur anywhere in a long clip, so trying to just render out a small section that has the problem is near impossible since most clips play fine. The clips that have the problem play fine of course in Plex web player, VLC, MXPlayer on adroid etc etc, so if it is some kind of malformation in the stream those players are all tolerant to it. I’m guessing it’s some kind of buffer overflow issue or similar.

If you’re willing, the smallest sample I have with the issue, which happens in the first 5 seconds of the clip, is still an 11.5GB file! Here is a dl link :

https://www.dropbox.com/s/nyoqomk91gcps3u/Antarctica%202018%204K.mp4?dl=0

You need to ensure the clip is playing DirectPlay not transcoded. Thanks!

I’ll download it.

Might be possible to create a smaller sample with dd.

MKVToolNix and ffmpeg would preserve the streams, but would also remux the container. Would be interesting if that made any difference, I suppose.

Just made a copy of the first 20 seconds of that clip with Plextranscoder in copy mode. The new copy does not crash the player! So that means that remuxing the video and audio has fixed the issue ? Will try making a copy of the whole clip and test.

Using Plextranscoder to copy the whole clip still has the copy crashing Plex player on Android - just at a different point in the clip. On most playback attempts Plex exits and restarts, on others it manages to successfully switch out of DirectPlay and into transcode mode and keep playing.

I’m seeing the same issue. I’ve been watching two season of Drive to Survive in 4K (first season in non-HDR, second in HDR) and 1-3 minutes before the end of each episode, the player crashes.

If I re-play the episode and seek to right before the timestamp of the crash, it will crash again on the same frame.

Worth mentioning is that as opposed to OP, I don’t crash on the same frame when playing the same file on my Android phone or in Plex Web; Only my SHIELD seems to crash.

08-02 17:02:27.998  i: [FFmpeg] [INFO] [https @ 0x29f490e000] Opening 'https://plex.my-domain.com:443/video/:/transcode/universal/session/7c9fee7a3f726c61-com-plexapp-android/base/00226.ts' for reading

08-02 17:02:27.998  i: [ExoPlayer][EventLogger] loading [eventTime=111.04, mediaPos=2184.36, window=0, period=0, true]
08-02 17:02:28.003  i: [ExoPlayer][EventLogger] loading [eventTime=111.04, mediaPos=2184.36, window=0, period=0, false]
08-02 17:02:28.079  i: [ExoPlayer][EventLogger] loading [eventTime=111.12, mediaPos=2184.44, window=0, period=0, true]
08-02 17:02:28.086  i: [ExoPlayer][EventLogger] loading [eventTime=111.13, mediaPos=2184.44, window=0, period=0, false]
08-02 17:02:28.239  i: [ExoPlayer][EventLogger] loading [eventTime=111.28, mediaPos=2184.60, window=0, period=0, true]
08-02 17:02:28.242  i: [ExoPlayer][EventLogger] loading [eventTime=111.28, mediaPos=2184.60, window=0, period=0, false]
08-02 17:02:28.318  i: [ExoPlayer][EventLogger] loading [eventTime=111.36, mediaPos=2184.68, window=0, period=0, true]
08-02 17:02:28.323  i: [ExoPlayer][EventLogger] loading [eventTime=111.36, mediaPos=2184.68, window=0, period=0, false]
08-02 17:02:28.469  i: [ExoPlayer][EventLogger] loading [eventTime=111.51, mediaPos=2184.83, window=0, period=0, true]
08-02 17:02:28.472  i: [ExoPlayer][EventLogger] loading [eventTime=111.51, mediaPos=2184.83, window=0, period=0, false]
08-02 17:02:28.524  i: [PlaybackTimeBehaviour] Time: 104299 IsStarted: true
08-02 17:02:28.551  i: [ExoPlayer][EventLogger] loading [eventTime=111.59, mediaPos=2184.91, window=0, period=0, true]
08-02 17:02:28.556  i: [ExoPlayer][EventLogger] loading [eventTime=111.60, mediaPos=2184.91, window=0, period=0, false]
08-02 17:02:28.632  i: [ExoPlayer][EventLogger] loading [eventTime=111.67, mediaPos=2184.99, window=0, period=0, true]
08-02 17:02:28.636  i: [ExoPlayer][EventLogger] loading [eventTime=111.68, mediaPos=2184.99, window=0, period=0, false]
08-02 17:02:28.712  i: [ExoPlayer][EventLogger] loading [eventTime=111.75, mediaPos=2185.07, window=0, period=0, true]
08-02 17:02:28.717  i: [ExoPlayer][EventLogger] loading [eventTime=111.76, mediaPos=2185.07, window=0, period=0, false]
08-02 17:02:28.795  i: [ExoPlayer][EventLogger] loading [eventTime=111.84, mediaPos=2185.16, window=0, period=0, true]
08-02 17:02:28.804  i: [ExoPlayer][EventLogger] loading [eventTime=111.85, mediaPos=2185.16, window=0, period=0, false]
08-02 17:02:28.893  i: [ExoPlayer][EventLogger] loading [eventTime=111.93, mediaPos=2185.25, window=0, period=0, true]
08-02 17:02:28.899  i: [ExoPlayer][EventLogger] loading [eventTime=111.94, mediaPos=2185.25, window=0, period=0, false]
08-02 17:02:28.956  i: [ExoPlayer][EventLogger] loading [eventTime=112.00, mediaPos=2185.31, window=0, period=0, true]
08-02 17:02:28.966  i: [FFmpeg] [INFO] [https @ 0x29ee01ec00] Opening 'https://plex.my-domain.com:443/video/:/transcode/universal/session/7c9fee7a3f726c61-com-plexapp-android/base/00227.ts' for reading

08-02 17:02:29.113  i: [ExoPlayer][EventLogger] videoDisabled [eventTime=112.15, mediaPos=2185.45, window=0, period=0]
08-02 17:02:29.120  i: [ExoPlayer][EventLogger] audioDisabled [eventTime=112.16, mediaPos=2185.45, window=0, period=0]
08-02 17:02:29.174  i: [FF][MediaPeriod] Releasing.
08-02 17:02:29.184  e: [ExoPlayer][EventLogger] playerFailed [eventTime=112.22, mediaPos=2185.45, window=0, period=0
  com.google.android.exoplayer2.l0: Unexpected runtime error
      at com.google.android.exoplayer2.p0.handleMessage(SourceFile:29)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      at android.os.Looper.loop(Looper.java:193)
      at android.os.HandlerThread.run(HandlerThread.java:65)
  Caused by: java.lang.ArrayIndexOutOfBoundsException: length=0; index=104
      at com.google.android.exoplayer2.source.o0.O(SourceFile:15)
      at com.google.android.exoplayer2.source.o0.R(SourceFile:2)
      at com.plexapp.plex.ff.source.FFMediaPeriod.readData(SourceFile:2)
      at com.plexapp.plex.ff.source.FFSampleStream.readData(SourceFile:1)
      at com.google.android.exoplayer2.f0.readSource(SourceFile:1)
      at com.google.android.exoplayer2.c2.t.feedInputBuffer(SourceFile:25)
      at com.google.android.exoplayer2.c2.t.render(SourceFile:18)
      at com.google.android.exoplayer2.p0.o(SourceFile:14)
      at com.google.android.exoplayer2.p0.handleMessage(SourceFile:25)
      ... 3 more
]
08-02 17:02:29.186  e: [Player][ExoPlayer] Playback error detected
08-02 17:02:29.186  e: An exception occurred: com.google.android.exoplayer2.l0: Unexpected runtime error
08-02 17:02:29.187  e: Stacktrace: com.google.android.exoplayer2.l0: Unexpected runtime error
	at com.google.android.exoplayer2.p0.handleMessage(SourceFile:29)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:193)
	at android.os.HandlerThread.run(HandlerThread.java:65)
Caused by: java.lang.ArrayIndexOutOfBoundsException: length=0; index=104
	at com.google.android.exoplayer2.source.o0.O(SourceFile:15)
	at com.google.android.exoplayer2.source.o0.R(SourceFile:2)
	at com.plexapp.plex.ff.source.FFMediaPeriod.readData(SourceFile:2)
	at com.plexapp.plex.ff.source.FFSampleStream.readData(SourceFile:1)
	at com.google.android.exoplayer2.f0.readSource(SourceFile:1)
	at com.google.android.exoplayer2.c2.t.feedInputBuffer(SourceFile:25)
	at com.google.android.exoplayer2.c2.t.render(SourceFile:18)
	at com.google.android.exoplayer2.p0.o(SourceFile:14)
	at com.google.android.exoplayer2.p0.handleMessage(SourceFile:25)
	... 3 more

08-02 17:02:29.187  i: [Player][Timeline] Handling player error
08-02 17:02:29.187  i: [Player][Timeline] Playback stopped (error: true)
08-02 17:02:29.195  i: [PlaybackTimeBehaviour] Time: 104970 IsStarted: true
08-02 17:02:29.195  i: [ExoPlayer][EventLogger] loading [eventTime=112.24, mediaPos=2185.45, window=0, period=0, false]
08-02 17:02:29.196  i: Fetching [method:GET] https://plex.my-domain.com:443/:/timeline?audioStreamID=889163&bufferedTime=74468&duration=2293000&guid=com.plexapp.agents.thetvdb%3A%2F%2F359913%2F2%2F8%3Flang%3Den&key=%2Flibrary%2Fmetadata%2F121318&playbackTime=104970&playQueueItemID=330077&ratingKey=121318&state=stopped&time=2185436&token=...GNWh&X-Plex-Client-Identifier=7c9fee7a3f726c61-com-plexapp-android&X-Plex-Token=...GNWh&X-Plex-Language=en-us
08-02 17:02:29.203  i: [ExoPlayer][EventLogger] state [eventTime=112.24, mediaPos=2185.45, window=0, period=0, IDLE]
08-02 17:02:29.204  i: [ExoPlayer][EventLogger] isPlaying [eventTime=112.25, mediaPos=2185.45, window=0, period=0, false]
08-02 17:02:29.210  i: [Player][Timeline] Player error not known by server, reporting original player error (or a playback interrupted one)
08-02 17:02:29.210  i: [Player] Error reported: UnknownError (null)
08-02 17:02:29.210  i: [Player][Timeline] Playback stopped (error: false)
08-02 17:02:29.220  i: [PlaybackTimeBehaviour] Time: 104994 IsStarted: true
08-02 17:02:29.220  i: Fetching [method:GET] https://plex.my-domain.com:443/:/timeline?audioStreamID=889163&bufferedTime=74468&duration=2293000&guid=com.plexapp.agents.thetvdb%3A%2F%2F359913%2F2%2F8%3Flang%3Den&key=%2Flibrary%2Fmetadata%2F121318&playbackTime=104994&playQueueItemID=330077&ratingKey=121318&state=stopped&time=2185436&token=...GNWh&X-Plex-Client-Identifier=7c9fee7a3f726c61-com-plexapp-android&X-Plex-Token=...GNWh&X-Plex-Language=en-us
08-02 17:02:29.232  i: [TranscodeSession] Stopping...
08-02 17:02:29.243  i: [Player][Error] Displaying player error...
08-02 17:02:29.244  i: [DialogBehaviour] Showing dialog.
08-02 17:02:29.249  i: [BufferHelper] Assumed Bitrate: 400000, Segment Count: 46875
08-02 17:02:29.250  i: [BufferHelper] Detected memory pressure, reducing segment count to fit available memory: 512
08-02 17:02:29.251  i: [BufferHelper] Segment count: 3276
08-02 17:02:29.252  i: [TranscodeSession] Notifying server that we've stopped

This seems to have started occuring only in the last few weeks - hard to say if it’s due to an update or something else.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.