Finally solved: Movies stopping in direct play after exactly 2 hours

Server Version#: 1.29.1.6316-7000
Player Version#: 5.47.1
So after years of people complaining about having some movies stop playback at the 2 hour mark (myself included) for no reason and no explanation from Plex tech support on how to resolve it, I have finally found the solution.

TLDR
Change/add the TranscoderDefaultDuration variable in the hidden server settings to however many minutes you want - from 120 (minutes) to something higher. Follow the link here on how to change it for your specifications: https://support.plex.tv/articles/201105343-advanced-hidden-server-settings/

Background
The conditions under which the 2 hour cut out would happen for me were as follows:

  • playing 4K H.265 movie over 2 hours long

  • matroska (.mkv) format

  • direct play enabled

  • Tizen basen player

  • Synology (Linux) based server

Effectively what would happen would be that at the 2 hour mark you’d be taken to the play completion screen with the replay option, cast interviews, etc. Just like the full film had played out. It even got marked as watched.

Tried all the options - power saving on the HDDs, converting to MP4, fiddling with all the direct play options. Nothing worked. And then I came across this gem: Playback Stops at 2:00:00

In it, it talks about default transcoding duration, which I swear I had seen before. Full credit to OP @CostaHT and the Plex admin @anon18523487 who were instrumental here.

Solution
So the solution. All that needs to be done is that one single default variable needs to be changed and it’s super easy. All you need to do is change/add the TranscoderDefaultDuration variable in the hidden server settings to however many minutes you want and that’s that. By default it’s 120 (minutes), hence the 2 hour cut out. You can follow the link here on how to change it for your specifications: https://support.plex.tv/articles/201105343-advanced-hidden-server-settings/

This might not work for everyone, but I hope it works for a fair whack of you. It’s been a thorn in the side for so many for so long. Happy watching everyone.

3 Likes

From what you saw was 120 minutes the default setting for that variable? If so, I’m surprised more people don’t hit that problem.

I wonder why they implemented a “screw up transcoding after this many minutes” variable anyway.

That setting is only applied if the duration of the video can’t be determined. This is used in case a video file is encoded badly and there isn’t an EOF (End of file) marker at the end. Without that EOF marker, the transcoder will keep running and never stop. Or it will read the data on your disk past where the file should have stopped and then fail or possibly even crash due to the data not being video.

3 Likes

Thanks for the explanation!

@anon18523487 from my limited experience so far, it just seems that it reaches the end of the film and then shows the buffering wheel. It remains this way for a few minutes until I get the playback error notification, but it will then take me to the play completion screen.

What I can also see is that the the proper length of the film is shown in the playback scrubber, so at some point soon after it starts playing, it does read the correct length.

For me, what I have set up is the “best solution” since it allows me to watch my 4k films in whole. I must emphasise that this is only an issue with 4k films that are forced to be transcoded. I haven’t another option since I get notified that I don’t have enough CPU power, which shouldn’t be the case, but that’s another issue.

@BanzaiInstitute, 120 minutes is the default per the documentation, although the variable didn’t originally appear in my preferences.xml file, so I had to add it in.

There’re a few variables in there which could also be time dependent, you can play with different transcoder settings, and given that this is a relatively rare event, I’m not really surprised that I haven’t found this solution anywhere.

It doesn’t look like anybody having this issue has provided logs for Plex to look at to try and determine what is actually happening. If more people are experiencing this issue but not actually posting, providing logs to Plex from people experiencing it can allow them to try and resolve the underlying issue.

-Shark2k

1 Like

So in other words the actual solution to this issue is to re-encode your video correctly with a widely accepted program instead of changing the variable. At least this is what I derive from the answer MovieFan has given.

I’m going to try to pull them later today. Didn’t have verbose logging setup properly do hopefully I can shed some more light on the matter then

You don’t want verbose logging on unless asked by someone from Plex.
Make sure debug logging in on and and verbose is off. Verbose tends to fill the logs to quickly to be able to see what is needed.

-Shark2k

That’s what I thought originally. I converted a couple of movies to MP4 per the supported files page: https://support.plex.tv/articles/203810286-what-media-formats-are-supported/

Unfortunately this renders the same problems.

I’ve also seen another table that says MKV is supported, but I can find that right now. I use that format just because it works best for me.

Yeah, fair enough. I’ll st that up instead. Thanks for the advice

1 Like

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