Stuttering in Plex playback of Handbrake encoded high bitrate MKVs

Any solution on solving the issue with “stuttering” during playback of high bit rate MKVs with PMS ?

This issue is really bothering me each time I play MKVs with higher bitrates (10+Mbps), expecially after encoding my blurays with Handbrake.

Somehow I suspect the way Handbrake process x264 encoding perhaps effects Plex’s ability to play the content seamlessly, but I simply cannot find the cause.
Lately I have tried changing encoding settings in Handbrake, but every variation still have stuttering (random, very brief stops during playback). I have tried several Handbrake versions, both base and nightly builds.

After extracting, I run the bluray content through Handbrake to reduce space. I have tried all sorts of x264 settings, but still no change so far:

  • cabac=1:ref=5:me=umh:subme=8:mixed-refs=1:merange=16:trellis=1
  • cabac=1:ref=5:me=umh:subme=9:mixed-refs=1:merange=16:trellis=2:psy-rd=1.0,0.0:deblock=0,0:analyse=0x3,0x133:bframes=1:b-adapt=2
  • cabac=1:ref=5:deblock=0,0:analyse=0x3,0x133:me=umh:subme=9:psy=1:psy-rd=1.0,0.0:mixed-refs=1:merange=16:chroma-me=1:trellis=2:8x8dct=1:fast-pskip=0:bframes=1:b-adapt=2
  • cabac=1:ref=5:me=umh:subme=9:mixed-refs=1:merange=16:trellis=1:psy-rd=1,0.15:b-adapt=2:direct=auto:deblock=-1,-1
  • cabac=1:ref=5:deblock=0,0:analyse=0x3,0x133:me=umh:subme=7:psy=1:psy-rd=1.0,0.0:mixed-refs=1:merange=16:chroma-me=1:trellis=1:8x8dct=1:fast-pskip=0
  • cabac=1:ref=5:me=umh:subme=8:mixed-refs=1:merange=16:trellis=1:deblock=-1,-1:psy-rd=1,0.15:direct=auto:b-adapt=2

Handbrake base settings:

  • Container: MKV
  • Anamorphic: Strict
  • Chopping: Auto
  • Filters off
  • Video: x264, Same/Constant FPS, Slow/Film/High/4.1, 9500 kbps/2-Pass/Turbo
  • Audio: Passthrough (corresponding)
  • Subs: Eng/Local subs
  • Chapters: enabled

I use the newest Plex client for my Samsung TV, and prefer to use Direct Play (with an external SRT) to get the best picture and sound quality.

Don’t think it is a hardware/specs/wifi issue (4-core/8G NAS, 1Gbps/Cat6a wired, corp-grade switch, latest PMS/Samsung for Plex versions, UHD/4-core TV).

Somehow I don’t recall having these stuttering when I started to use Plex 1½ year ago, but the last year or so, this issue have really caused so much pain …

I really hope someone knows how this can be solved … anyone … Plex ?

Thanks :slight_smile:

What are your audio settings for your Plex server, the source file (assume AC-3?) and the Samsung TV plex player? I find many times that the stuttering isn’t due to video but the audio settings.

You should never use these advanced parameters. They are just not sensibly useful to an end-user. That’s why the Handbrake developers have (rightly so) hidden them in the newer versions.

You did not mention what type of rips you did encode.
The Anamorphic parameter usually only makes sense with DVD rips. A BluRay rip usually should have this set to ‘None’.
All your parameter sets have 5 Reference frames set. If you use a FullHD BluRay rip, this might be too high for some Samsung models. (5 RefFrames at 1920x1080px exceed the boundaries of the H.264 Level 4.1)

Switch off the advanced parameters in the preferences of Handbrake.
Use the predefined Handbrake Preset ‘Regular - High Profile’ as basis
Then just adjust the Anamorphic parameter according to the source material (DVD=yes, BluRay=none)
on the Filters tab, set everything to ‘off’ for BluRay rips,
activate ‘Decomb-default’ for interlaced material (check with mediainfo whether the source file uses interlacing)
on the Video tab set ‘Constant Quality’ to 18-22 RF for DVD rips and 16-20 RF for BluRay rips (smaller number=higher quality and bandwidth)
Leave the H.264 Level at 4.1!
Under ‘Optimise Video’ leave the x.264 Preset slider at Medium, or move it to slower settings for higher coding efficiency and thus, lower bitrate (while maintaining the same quality)

Use these parameters as a basis for your own encodings. Adapt the rest of the settings (audio tracks, subtitles) as you see fit.

You were a bit unclear whether your TV is connected by Ethernet or wireless.
My recommendation is: if you use higher bitrate files, you want wired - both for the server and for the TV.

@tmar89 said:
What are your audio settings for your Plex server, the source file (assume AC-3?) and the Samsung TV plex player? I find many times that the stuttering isn’t due to video but the audio settings.

Not sure what setting you refer to ?
If at all possible I pass through the primary audio stream (DTS-HD over DTS over AC3, and 7.1 over 5.1), to get the best audio level for my home cinema.

Can you point me to the setting you mean ?

@OttoKerner:

Sorry I forgot to mention that I started encoding with basic settings (those listed) and after being fed up by the stuttering, I started experimenting with the advanced settings, but so far with absolute no success.
Today I tried to remove the included subtitles (PGS), but still no change.

All my sources are pure Bluray exports.

What setting would you recommend for Ref, instead of 5 ?
When comparing with other peoples results - where stuttering is not an issue - the ref=5 seems to be the predominant setting. How come this can cause stuttering in this case ?

I got the impression that “Strict” Anamorphic is the best choise as this preserves the full frames as displayed on the source. When started with Handbrake, I did try “Loose” Anamorphic but after getting some odd results, I sticked with “Strict”.
How come this is different for Bluray, and how is this related to stuttering during Direct Play ?

I noticed the continuous debate around “Constant Quality” vs “Average bitrate”.
When I started using Handbrake i also tried Constant Quality, but filesize is unpredictable, and I found myself using too much time recoding to get a better “quality/filesize” ration.
I found that based on a bluray source on a 55" UHD screen, an average bitrates of about 9500 kbps provided excellent results, so I have sticked with this setting.
How come the use of average bitrate cause stuttering ?

With regards to networking, all my endpoints (including NAS and TV) are connected with 1Gbps wired Ethernet patched to an enterprise grade switch on shielded Cat 6a cables.
During Direct Play, the NAS bandwidth utilization seems to be at a quite low level.

Can you please elaborate on the background or root case of this stuttering ?
Why do encoding with Handbrake, using standard settings, cause stuttering when doing Direct Play ?

@jakon said:
All my sources are pure Bluray exports.

I probably forgot to explicitly mention that many devices only support the h.264 Level of ~4 or 4.1
simply because level 5 would require much more RAM for the decoder (amongst other things).

What setting would you recommend for Ref, instead of 5 ?

As I explained, RefFrames of 5 for a fullframe, uncropped BluRay picture will exceed the boundaries of Level 4.1. The maximum is 4 RefFrames.

When comparing with other peoples results - where stuttering is not an issue - the ref=5 seems to be the predominant setting. How come this can cause stuttering in this case ?

If you however crop the black bars from Cinemascope movies (2.35:1), you can use 5 RefFrames, because the pixelcount is now lower.

I got the impression that “Strict” Anamorphic is the best choise as this preserves the full frames as displayed on the source. When started with Handbrake, I did try “Loose” Anamorphic but after getting some odd results, I sticked with “Strict”.
How come this is different for Bluray, and how is this related to stuttering during Direct Play ?

Most of the time, BluRay uses square pixels. The picture is thus not anamorphic.
Therefore the ‘anamorphic’ flag must not be set in the video stream. If it is set to ‘on’ when not necessary, the behaviour of players may be different/weird.

Matters are complicated further, because BluRay may also contain anamorphic video. Usually used when standard definition video is stored (usually bonus content or tv show episodes or generally older material which was originally mastered for DVD).

DVD on the other hand uses always rectangular pixels.
The aspect ration of these pixels differs, depending on whether the video is encoded as widescreen (16:9) or fullframe 4:3 format.
But it is always anamorphic.
See: https://trac.handbrake.fr/wiki/AnamorphicGuide

I noticed the continuous debate around “Constant Quality” vs “Average bitrate”.
How come the use of average bitrate cause stuttering ?

It doesn’t. It was just meant as a general recommendation. You can usually get a more efficient encode (better quality / file size ratio) with constant quality (if you invest the computing time).
If you prefer average bitrate, then use that.

With regards to networking, all my endpoints (including NAS and TV) are connected with 1Gbps wired Ethernet patched to an enterprise grade switch on shielded Cat 6a cables.

Perfect.

Can you please elaborate on the background or root case of this stuttering ?
Why do encoding with Handbrake, using standard settings, cause stuttering when doing Direct Play ?

I was especially referring to your use of 5 Reference frames. This can overtax the decoder in some models and thus lead to weird decoding artefacts or stuttering.

There was lately an issue solved within the Plex server which also could lead to stuttering on Samsung TVs. I think the Samsung Smarthub subforum has a few threads about it.
I hope your PMS version is recent?

@OttoKerner:

I have tried recoding with Ref=4 and stuttering is unchanged.
I always set Cropping to Auto, which should bring the frame within the limits if 5 RefFrames.

Btw, here are the default x264 settings Handbrake uses for the base settings I posted initially:

level=4.1:ref=5:b-adapt=2:direct=auto:deblock=-1,-1:me=umh:subme=8:psy-rd=1.00,0.15:vbv-bufsize=78125:vbv-maxrate=62500:rc-lookahead=50

I checked the PMS version on my NAS today. It is 0.9.15.4, which is from 16. February 2016.
I’ll try to update it to the latest version (0.9.16.3), to see if this changes anything.

The Plex for Samsung client on my TV is version 2.005, which should be the latest version.

Changing RefFrames from 5 to 4 doesn’t seem to have any effect towards eliminating stuttering during Direct Play, so I am still looking for a solution :slight_smile:

Do you (or anyone else for that matter) have other solutions - if the PMS upgrades from the last month does not solve this ?

@jakon said:
I always set Cropping to Auto, which should bring the frame within the limits if 5 RefFrames.

Not all movies are in cinemascope, there are plenty of full frame movies out there - which won’t get cropped.

The Plex for Samsung client on my TV is version 2.005, which should be the latest version.

Yes this is the same version as I use.

Do you (or anyone else for that matter) have other solutions - if the PMS upgrades from the last month does not solve this ?

Apart from that, sorry no.
I even use higher bandwidth files on the TV (UE65H6400) and they all play OK (with the exception of one with first audio track in TrueHD, but that was my mistake).

@OttoKerner:

Thanks for taking time to help and post your suggestions :slight_smile:
Anyway, Plex should get involved in this case - but how do I open a support “case” with the “official” Plex Support ?

This is the official Plex support.
Plex already got involved. They put out an updated Server version. Have you installed the latest Server version yet?
Keep also in mind that the Samsung Smarthub client is a one-man side-project. Not an official Plex product.

@OttoKerner:
I have downloaded the latest PMS and plan to update my NAS today.

You mentioned the Plex client for Samsung …
I cannot believe that any serious company would entrust the development of the client for one of the most important customer platforms to a non-official, one-man side-project … that is such an unbelievable unprofessional attitude.
Imagine if Microsoft only provided Windows Server, but left the development of the Windows Client into a non-official, one-man side-project … it would be nightmare, and properly never allowed Microsoft anywhere their current success.
Luckily for us all, Orca has invested a lot of time and energy in the project, but as a customer where is the official support if something is not working properly ? I have payed Plex for the software and support, but I have not payed Orca anything … so where does that leave me as a customer ?
Come on Plex, get serious here and take a professional responsibility for both the server and the client.

@OttoKerner: Sorry for barking at the messenger :wink: I’ll post status after upgrading the PMS.

@jakon said:
I cannot believe that any serious company would entrust the development of the client for one of the most important customer platforms to a non-official, one-man side-project … that is such an unbelievable unprofessional attitude.

It it weren’t for that “un-professional one-man project”, there wouldn’t be a Plex client for this platform at all.

I think Plex are actually building a new samsung app… I’m sure @Orca mentioned it a while back. However whatever Plex build with a multitude of staff will never match the outstanding app built by orca.

from post in dec 2015 https://forums.plex.tv/discussion/45444/from-the-developers-if-there-is-any-news-its-in-here#latest

For 2016 the Plex team has taking up the gauntlet to get their app up to speed with the current Samsung app.
That means that my Tizen app will not become available from the store for Tizen. (or on USB for that matter)
So there will still be a Tizen Samsung app, although it will not be mine and it will have the look and feel of the existing Smart TV apps. When it will be done? I don’t know it’s out of my hands now.

@OttoKerner said:

@jakon said:
I cannot believe that any serious company would entrust the development of the client for one of the most important customer platforms to a non-official, one-man side-project … that is such an unbelievable unprofessional attitude.

It it weren’t for that “un-professional one-man project”, there wouldn’t be a Plex client for this platform at all.

Would there then be any financially foundation for Plex Inc at all … the monthly paycheck for the employees in Plex Inc has to come from somewhere … and that is the customers. And I bet all the Samsung owners around are contributing a substantial portion (read that Samsung has around 50% market share with 3 mio screens sold each month). Plex Inc is not a volunteer project (anymore), but a business that sells products, including Plex Media Server. But no clients means no customers for the server product, which again means no income and no salaries, which inevitable means no employees … and no business.
It’s not complicated, just business.

@reddwarfcrew said:
I think Plex are actually building a new samsung app… I’m sure @Orca mentioned it a while back. However whatever Plex build with a multitude of staff will never match the outstanding app built by orca.

from post in dec 2015 https://forums.plex.tv/discussion/45444/from-the-developers-if-there-is-any-news-its-in-here#latest

For 2016 the Plex team has taking up the gauntlet to get their app up to speed with the current Samsung app.
That means that my Tizen app will not become available from the store for Tizen. (or on USB for that matter)
So there will still be a Tizen Samsung app, although it will not be mine and it will have the look and feel of the existing Smart TV apps. When it will be done? I don’t know it’s out of my hands now.

That is for the newest Tizen platform, what about support of the current Samsung platform, and solving the issues I and many others experience with stuttering ?

Just upgraded the PMS to 0.9.16.3, restarted the app, restarted the TV and opened up the Plex client.
Still random stuttering, often several times per minut during playback in Direct Play.

Check the resource utilization on the NAS, during playback.
For CPU, all 4 cores are almost idling, with a few, short peaks to around 12% for core 1 only.
For Memory, the system uses 1,06 GB out of 7,70 GB available. Swap uses 230 MB out of 517 available.
For Network, out of 4 connected (using IEEE 802.3ad port trunking) only Ethernet 1 has sent data, ranging from 3,9 MB/s declining to 2,0 MB/s. Ethernet 2 and 4 has received 20 KB/s and 2 KB/s data during the playback.
For Disks, IOPS has started with 40 IOPS declining to 20 IOPS during the playback. Latency has been about 10 ms during playback.
Basically the NAS has been not used any significant amount of system resources during playback.