Example of stuttering HEVC playback on Apple TV 4K

Here’s some MediaInfo

General
Unique ID                                : 294929359367598781318802917786794695715 (0xDDE1541682FA64091E06DADBA4159C23)
Complete name                            : <redacted>
Format                                   : Matroska
Format version                           : Version 4
File size                                : 12.8 GiB
Duration                                 : 1h 52mn
Overall bit rate                         : 16.4 Mbps
Encoded date                             : UTC 2020-07-19 03:04:23
Writing application                      : mkvmerge v48.0.0 ('Fortress Around Your Heart') 64-bit
Writing library                          : libebml v1.4.0 + libmatroska v1.6.0

Video
ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5.1@High
HDR format                               : SMPTE ST 2086, HDR10 compatible
Codec ID                                 : V_MPEGH/ISO/HEVC
Duration                                 : 1h 52mn
Bit rate                                 : 15.5 Mbps
Width                                    : 3 840 pixels
Height                                   : 1 600 pixels
Display aspect ratio                     : 2.40:1
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 10 bits
Bits/(Pixel*Frame)                       : 0.105
Stream size                              : 12.1 GiB (95%)
Language                                 : English
Default                                  : Yes
Forced                                   : No
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : Display P3
Mastering display luminance              : min: 0.0050 cd/m2, max: 4000 cd/m2

I’m not very knowledgeable about video streaming but of late I have found that some of my .MP4 files are unplayable with stuttering which includes a short rewind bouncing effect on the video. As yet I’ve not found a .MKV file which exhibits this problem. I tried changing a few settings without success.

Problematic .mp4 files will not have a ctts atom present in their HEVC stream. One method of regenerating it is to pass it through mkvtoolnix v45 or later, then back into a .mp4 if required.

This symptom is basically what we observed with .mp4 files which were created using HEVC streams which were at some point processed using mkvtoolnix with a version of at least v44, preventing the ctts atom from being generated when the .mp4 file was created. This was corrected by processing the HEVC stream through mkvtoolnix v45 or later, details on what and how are available elsewhere in this thread.

As long as the .mkv built using mkvtoolnix prior to v45 does not need to be repackaged in a .mp4 container, the problem will not be present.

1 Like

So I understand - is this something which plex is likely to address and provide an update for, or is it an error in the way the video was created in the first place which I need to correct using the tools you mention. I use a Mac so I’m not sure if I can use those.

The ‘enhanced’ player in the official Plex iOS and tvOS clients has already corrected the problem this thread was opened to investigate. Is it enabled for your devices? If your files are exhibiting the problem when the ctts atom is present, it’s a different issue and you’ll need to provide further diagnostic detail.

I’d recommend correcting or replacing any problematic files, they’re basically malformed and problems may manifest with them in the future.

All the tools I have specified in my posts above are available for macOS, it’s where I have and continue to use them. Homebrew is one place to start.

On the new Plex player, I am still having the stuttering issue. This is honestly ridiculous.

Do you have an example file others can inspect?

I feel like the file encoding is unlikely the problem seeing that almost every other player out there will stream the file perfectly (eg. VLC, Infuse, Kodi). Seems more likely the problem is within the way Plex is decoding the file. No?

I am having this issue on my Samsung TV. All other Plex clients don’t have the problem. I didn’t get any answer on my topic unfortunately.

Plex keeps stating this issue is fixed but it clearly isn’t. Here we all are

The problem originally identified in this thread has been confirmed as resolved, if you’re still experiencing problems it’s not because of the original problem.

Examples are key to identifying the root cause, more diverse examples will increase the likelihood of a viable solution.

Correction: The problem originally identified in this thread, has been resolved for one person with a specific use case. Lot’s of other problems covered by the heading of this thread have not been resolved.

I’ve been regularly encoding to mkv for a number of years using both handbrake and ffmpeg and both now produce stuttering. I’m not updating the files and remuxing them, because I just did that to create an HEVC version of my file, so I know the file isn’t broken.

It is not a ‘thing’ to encode files for Plex, Plex’s main selling point (always has been) is you can throw anything at it and it will transcode it into the format your client needs. If that’s broken, then it should be fixed.

Given the same file plays on the Official Plex client on iOS (something mentioned at the beginning of this thread) it seems likely the issue is specific to Plex on TVOS.

2 Likes

This is still broken for playing the effected files on Android (at least on a Galaxy S10+). To the best of my knowledge Android does not have access to the Enhanced Player, or at least does not have a setting to toggle it like AndroidTV and iOS do. This may be the root issue here, but it is still a big issue that a fairly large amount of devices have an issue that others do not.

I have always repackaged mp4 files to mkv files to make it simpler with all files having the same extension, so in my case it’s just a matter of modifying my script to also “fix” all mp4s as well as repack them as mkv. A lot of other users probably do not do this and may not even understand how to, be as Plex is a service that advertises itself to be really simple software. This issue with particular client apps breaks that simpleness.

I do believe it doesn’t matter if I play them on advanced or normal player. I’ve tried both. I actually thought my encoding libraries must have a bug until I realised it was only one client having issues.

1 Like

HEADS-UP: some of the problematic videos are being re-posted to RARBG, with the same problem as before (missing ctts atom). mediainfo even shows the same encode date as before - i.e., during the time when mkvmerge had the bug. Examples include the Batman movies. If folks have already downloaded these and fixed them, there is no need to re-download and re-fix. Those downloading for the first time will have to fix them.

1 Like

For anyone that has a bunch of videos to fix, here’s the bash script I wrote. You must have mkvmerge and ffmpeg installed. Cd into a folder that contains faulty mp4s or subdirectories with faulty mp4s. It will recursively search for and process any mp4 it finds, create a tmp video file and a temp audio and subtitle file, then recombine them into a new mkv file that contains all of the video, audio, and subtitle tracks as the original. There is no re-encoding, just remuxing the files, so no loss of quality and the resulting file is the same size as the original. Also, it does delete the tmp files it creates, but it leaves the original mp4 files untouched. I prefer to delete those by hand once I know everything is working good. If you prefer mp4s, you can modify it to spit out mp4s, however you can’t periodically run it on the same set of folders without it needless processing the same files over and over again. To mitigate the issue with these mp4 files, I just process all mp4s so they will work regardless of whether or not they had a problem originally.

Naturally, use this at your own risk. It has worked perfectly for me, however I have not tried it on every single .mp4 files out there, and I can’t be held responsible for whatever happens.

3 Likes

Yep - buyer beware.

They’re ‘Re-Releasing’ Broken Files and deleting all comments suggesting their stuff is broke… so it won’t tarnish their stellar reputation…lol

If you need, get.
Then Fix.

3 Likes

Ok, Ho,Ho,Hooo and a bottle of Rum. Thank goodness for MKVToolNix

1 Like

MKVToolNix. The cause of, and solution to, this entire thread.

5 Likes