Roku player (including Plex) stops playback on some MKVs that contain PGS (forced only) subtitle streams

MKV playback, recompression, remuxing, codec packs, players, howtos, etc.
Post Reply
ZU476B72N4PC
Posts: 10
Joined: Sat Mar 20, 2021 5:00 pm

Roku player (including Plex) stops playback on some MKVs that contain PGS (forced only) subtitle streams

Post by ZU476B72N4PC » Sat Mar 20, 2021 5:38 pm

Hi folks,

I've been having a problem with certain MKVs direct streamed using Plex to a Roku- I started a thread in Plex support about the issue. However, I recently tested with the MKV files on a USB stick and it exhibits the same behavior, which means the problem is between the MKV file and Roku OS itself, not Plex.

The Roku will abandon playback shortly after starting to play the MKV, anywhere from 13 seconds in to a couple minutes in. I did many, many tests with different MKV export parameters and narrowed the issue down to only occurring when a PGS (forced only) subtitles stream is present in the MKV.

Image

In reviewing some of the Plex logs that I posted in their support thread, it appears that the player thinks it's getting a signal from a subtitle stream that the title is over so it stops playback.

Code: Select all

3/13/2021 13:42:18.557 [num:email:ID] INFO (PlaybackMgr) VideoPlaybackController::UpdateSubtitleSuppression: state=finished trackName=mkv/off suppressCaptions=true
3/13/2021 13:42:18.560 [num:email:ID] INFO (PlaybackMgr) Player state changed to finished (hasAd=false)
I believe that Roku doesn't support image subtitle formats like PGS. However, I'm playing these movies with subtitles disabled in settings. Is there a possibility that MakeMKV is doing something weird with the forced subtitles stream such that it has a premature end signal, perhaps when reordering chunks of a title with FPL obfuscations?

Titles where I've experienced this issue include Lady Bird, Blindspotting, Once Upon a time in Hollywood 4K. The first two are Lionsgate with FPL but the third isn't. All of them work fine when I uncheck the PGS (forced only) subtitles stream when creating the MKV.

Anyone else have this issue with MakeMKV and Roku or have any ideas about the true cause?

Woodstock
Posts: 10332
Joined: Sun Jul 24, 2011 11:21 pm

Re: Roku player (including Plex) stops playback on some MKVs that contain PGS (forced only) subtitle streams

Post by Woodstock » Sat Mar 20, 2021 6:05 pm

In your MakeMKV log for the rip, did it mention that the stream was removed because it is empty?

The "forced only" track you see in the selection screen is created by MakeMKV if the parent stream contains subtitles that are flagged as forced. That is very rare.

ZU476B72N4PC
Posts: 10
Joined: Sat Mar 20, 2021 5:00 pm

Re: Roku player (including Plex) stops playback on some MKVs that contain PGS (forced only) subtitle streams

Post by ZU476B72N4PC » Sat Mar 20, 2021 7:17 pm

I think I found the issue. Every "bad" MKV that causes a crash on Roku has non-consecutive stream numbers, i.e. a gap in stream numbering is created when the empty tracks are removed from the file. In contrast, when the "forced" boxes have been unchecked all along, all stream numbers are consecutive and Roku has no problems playing the file.

I see this at the end of the log:

Code: Select all

004047:0010 AV sync issue in stream 5 at 0:00:00 : Forced subtitles track #5 turned out to be empty and was removed from output file
004047:0010 AV sync issue in stream 7 at 0:00:00 : Forced subtitles track #7 turned out to be empty and was removed from output file
...and Roku player will quit playing this MKV after about 13 seconds.

Checking MediaInfo, I see two resulting subtitle tracks in the MKV with ID:5 and ID:7. Looks like the fact that it skips ID:6 is causing it to abandon playback. I have confirmed a similar gap in numbering happens on all other titles that are having problems.

Code: Select all

Text #1
ID                                       : 5
ID in the original source medium         : 4608 (0x1200)
Format                                   : PGS
Codec ID                                 : S_HDMV/PGS
Codec ID/Info                            : Picture based subtitle format used on BDs/HD-DVDs
Duration                                 : 1 h 33 min
Bit rate                                 : 55.1 kb/s
Count of elements                        : 3236
Stream size                              : 36.8 MiB (0%)
Language                                 : English
Default                                  : No
Forced                                   : No
Original source medium                   : Blu-ray

Text #2
ID                                       : 7
ID in the original source medium         : 4609 (0x1201)
Format                                   : PGS
Codec ID                                 : S_HDMV/PGS
Codec ID/Info                            : Picture based subtitle format used on BDs/HD-DVDs
Duration                                 : 1 h 28 min
Bit rate                                 : 46.2 kb/s
Count of elements                        : 2654
Stream size                              : 29.1 MiB (0%)
Language                                 : Spanish
Default                                  : No
Forced                                   : No
Original source medium                   : Blu-ray
A full remux of a problematic file using MKVToolNix re-does the numbering to be totally sequential and fixes the playback issue.

I have no idea whether having non-consecutive stream numbers is compliant or not with the Matroska format, but any chance MakeMKV could be updated to fix this issue?

Woodstock
Posts: 10332
Joined: Sun Jul 24, 2011 11:21 pm

Re: Roku player (including Plex) stops playback on some MKVs that contain PGS (forced only) subtitle streams

Post by Woodstock » Sat Mar 20, 2021 9:52 pm

That is very weird - track numbers do not have to be contiguous in MKV files.

Not having either Plex or Roku operational, I can't help point you in the correct direction, but Plex is the next logical step in the chain. If a playback device cannot handle a particular track, Plex can remove it.

ZU476B72N4PC
Posts: 10
Joined: Sat Mar 20, 2021 5:00 pm

Re: Roku player (including Plex) stops playback on some MKVs that contain PGS (forced only) subtitle streams

Post by ZU476B72N4PC » Sat Mar 20, 2021 10:15 pm

The Plex developer I was able to reach immediately pointed their finger at the container and implied the Roku Media Player is very picky about some stuff. Apparently the playback decoding, though launched through Plex app, is handled natively by the Roku OS media player.
To isolate this, I copied the MKV to a USB flash drive and attempted to run it with the Roku Media Player and observed the exact same problem, playback is abandoned 13 seconds in. So it's a Roku native decoding peculiarity, nothing to do with Plex really.

I attempted their suggestion of running the file through mkclean, but I can now see that that doesn't change the stream numbering so the issue persists.

If MakeMKV cannot be updated to clean this up, is there an easy way to renumber the streams to contiguous without doing a full remux with MKVToolNix?

Woodstock
Posts: 10332
Joined: Sun Jul 24, 2011 11:21 pm

Re: Roku player (including Plex) stops playback on some MKVs that contain PGS (forced only) subtitle streams

Post by Woodstock » Sat Mar 20, 2021 10:25 pm

You can use mkvmerge to construct a new copy, with the tracks renumbered. It's a bit tedious to do that, though, unless you use the command line interface.

ZU476B72N4PC
Posts: 10
Joined: Sat Mar 20, 2021 5:00 pm

Re: Roku player (including Plex) stops playback on some MKVs that contain PGS (forced only) subtitle streams

Post by ZU476B72N4PC » Sat Mar 20, 2021 11:40 pm

Ok, wrote the following .bat that I can keep in the folder and drop the output from MakeMKV onto:

Code: Select all

@ECHO OFF
set finalname=%~n1.REMUXED.mkv
"C:\Program Files\MKVToolNix\mkvmerge.exe" -o "%finalname%" %1
Last edited by ZU476B72N4PC on Thu Feb 03, 2022 12:21 am, edited 1 time in total.

cmis003
Posts: 1
Joined: Fri Jan 07, 2022 2:53 pm

Re: Roku player (including Plex) stops playback on some MKVs that contain PGS (forced only) subtitle streams

Post by cmis003 » Sat Jan 15, 2022 4:38 pm

Woodstock wrote:
Sat Mar 20, 2021 10:25 pm
You can use mkvmerge to construct a new copy, with the tracks renumbered. It's a bit tedious to do that, though, unless you use the command line interface.
I had a similar problem as the OP. Interestingly, only some titles with non-consecutive stream numbers exhibited the problem. Others played just fine. In any case, using mkvmerge to contruct a new (but otherwise unchanged) copy solved the issue.

Thanks to ZU476B72N4PC for posting the problem and helping find a solution.

Chetwood
Posts: 982
Joined: Mon Aug 30, 2010 9:16 am

Re: Roku player (including Plex) stops playback on some MKVs that contain PGS (forced only) subtitle streams

Post by Chetwood » Sat Jan 15, 2022 10:53 pm

Since most US BDs don't have tracks with forced items you could uncheck that box and have MakeMKV mux the file with consecutive tracks.
MultiMakeMKV: MakeMKV batch processing (Win)
MultiShrink: DVD Shrink batch processing
Offizieller Uebersetzer von DVD Shrink deutsch

ssybesma
Posts: 17
Joined: Sat Jul 10, 2021 12:49 am
Location: Brighton, CO

Re: Roku player (including Plex) stops playback on some MKVs that contain PGS (forced only) subtitle streams

Post by ssybesma » Sat Jan 29, 2022 5:54 pm

ZU476B72N4PC wrote:
Sat Mar 20, 2021 11:40 pm
Ok, wrote the following .bat that I can keep in the folder and drop the output from MakeMKV onto:

Code: Select all

@ECHO OFF
set finalname=%~n1.REMUXED.mkv
"A:\Program Files\MKVToolNix\mkvmerge.exe" -o "%finalname%" %1
del %1
Hello ZU476B72N4PC,
I would like to use this batch file that you created but a few questions.
Scenario: I have all my MKVs that need this remux process already in a folder where MakeMKV put them...that is, C:\Users\PENGUIN\Videos\MakeMKV\Star Trek TOS. Your batch file is in that same folder.
1.Can I just take the mkvmerge.exe file itself, put in that folder, change path for mkvmerge.exe in your batch file and run it or does mkvmerge.exe depend on other files from MKVToolNix?
2.Can your batch file operate on all *.MKV files it sees in folder it's run from?
3. How do I specify source (MKV) files and what is correct syntax? See below command line errors related to unspecified source files and incorrect syntax.

Whether batch command points to mkvmerge.exe in original folder MKVToolNix was installed in or whether it points to mkvmerge.exe copied into folder MKV files are in I get these errors:

C:\Users\PENGUIN\Videos\MakeMKV\Star Trek TOS>REMUX.BAT
mkvmerge v58.0.0 ('Supper's Ready') 64-bit
Error: No source files were given.
The syntax of the command is incorrect.

Obviously not doing something right...just haven't figured out yet...this batch below was used on 2nd attempt and gave identical errors.

@ECHO OFF
set finalname=%~n1.REMUXED.mkv
"C:\Users\PENGUIN\Videos\MakeMKV\Star Trek TOS\mkvmerge.exe" -o "%finalname%" %1
del %1

Steve

ssybesma
Posts: 17
Joined: Sat Jul 10, 2021 12:49 am
Location: Brighton, CO

Re: Roku player (including Plex) stops playback on some MKVs that contain PGS (forced only) subtitle streams

Post by ssybesma » Sun Jan 30, 2022 5:56 pm

I found a solution for the Roku for MKV files that Roku Media Player won't play.

The Emby app for Roku plays them without a hitch. Therefore this doesn't seem to be a Roku OS issue...it's a Roku app issue.

Steve

Post Reply