# Bizarre - PMS transcoding

**URL:** <https://forums.plex.tv/t/bizarre-pms-transcoding/637564>\
**Category:** Plex Media Server\
**Tags:** server-mac, apple-tv, plex-web\
**Created:** [September 28, 2020, 2:30am UTC](https://forums.plex.tv/t/bizarre-pms-transcoding/637564 "2020-09-28T02:30:16Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![moondigger](https://avatars.discourse-cdn.com/v4/letter/m/838e76/32.png) [@moondigger](https://forums.plex.tv/u/moondigger)\
**Post date:** [September 28, 2020, 2:30am UTC](https://forums.plex.tv/t/bizarre-pms-transcoding/637564/1 "2020-09-28T02:30:17Z")

</div>

Server Version#: 1.20.2.3343  
Player Version#: Web, AppleTV, etc

I’ve run into a bizarre issue with Plex for remote users.

I always aim for a bitrate of 10 Mbps or below for my shared movie content, to ensure that most clients can direct play it. (I use Handbrake.) Under Plex Web --\> Quality, I’ve set it to “12 Mbps, 1080p.”

This only happens for some movies. The best way to explain what’s happening is by example, so I’ll use Once Upon a Time in Hollywood as the example.

As it’s currently encoded, the file is is less than 7 Mbps. If I “get info” from within Plex, it shows as “6592 kbps.”

When I attempt to play the file remotely either via the AppleTV Plex app or via the web app, the server transcodes the file. If I look under “Technical Details” in the AppleTV Plex app, while the movie is playing, it says both video and audio are being transcoded, and under “Transcode Reason,” it says “Not enough bandwidth for direct play of this item. Required bandwidth is 40642kbps and only 12000kbps is available.”

40642 kbps??? Where is that number coming from? Why does PMS and/or the Plex playback app think the bitrate is anything other than the actual bitrate of 6592 kbps?

As I mentioned before, this is happening with several, but not all, movies. The numbers are different depending on the movie, but in all cases Plex thinks the required bitrate is much, much higher than the actual bitrate of the file being streamed.

As you can imagine, this unnecessary forced transcoding is reducing the number of simultaneous movies that can be served.

Any ideas?

---

<div class="post-metadata">

**Author:** ![moondigger](https://avatars.discourse-cdn.com/v4/letter/m/838e76/32.png) [@moondigger](https://forums.plex.tv/u/moondigger)\
**Post date:** [September 28, 2020, 3:03am UTC](https://forums.plex.tv/t/bizarre-pms-transcoding/637564/2 "2020-09-28T03:03:14Z")

</div>

I’ve done a little bit more checking, at it turns out most movies exhibit a similar problem, with Plex thinking they require much more bandwidth than they really do. I only noticed it with some of them, because the 12 Mbps limit allows many of them to direct play anyway, even with the ‘inflated’ reported bitrate. For example, many modern movies shot with digital movie cameras have very low noise and compress extremely well, so they might be only 3 or 4 mbps. Plex still thinks they require much higher bandwidth than they actually do (such as 10 or 11 Mbps). But because 10 or 11 mbps is less than the 12 Mbps limit I set, they direct play.

I hope this makes sense.

---

<div class="post-metadata">

**Author:** ![Volts](https://avatars.discourse-cdn.com/v4/letter/v/a5b964/32.png) [@Volts](https://forums.plex.tv/u/Volts)\
**Post date:** [September 28, 2020, 3:45am UTC](https://forums.plex.tv/t/bizarre-pms-transcoding/637564/3 "2020-09-28T03:45:22Z")

</div>

As you’re discovering, video bitrates are hugely variable. A still scene requires almost no bits; a scene with fast action may need 10x the median.

This makes the “Average Bitrate” of a file **very** misleading.

Plex analyzes files to identify the moment-by-moment bitrate throughout the video. Plex also knows the buffer size of each client. It uses these together to calculate the streaming bandwidth requirements.

When you look at a file’s info in Plex, `bitrate` is the file average. But if you look at the XML, `requiredBandwidths` shows how much bandwidth is needed to accommodate bitrate bursts at different buffer sizes. Before a file is analyzed, a fudge factor multiplier is used.

Handbrake’s “Average Bitrate” mode controls the total file size, not moment-to-moment bitrate. A file produced with “Constant Quality” and “Average Bitrate” modes will have the same peaks and valleys in bitrate. “Average Bitrate” mode is how you create a file that’s the perfect total size for a CD or DVD, not how you target a streaming bandwidth.

If you are targeting specific bandwidth, and want to pre-encode your video, one option is to use Plex’s built-in Optimizer presets. They tightly control bandwidth & required buffer sizes to maximize video quality for specific bandwidth settings.

If you want to encode for specific streaming bandwidth yourself, there’s an exhaustive thread about it here:

> [@\[How To\] Pre-encode to avoid Transcoding (using VidCoder Presets)](https://forums.plex.tv/t/how-to-pre-encode-to-avoid-transcoding-using-vidcoder-presets/573857):
>
> Hi all, [Downmix your Surround Sound to Stereo before using this “Pre-encoding” guide](https://forums.plex.tv/t/how-to-downmix-surround-sound-to-aac-stereo-properly-using-ffmpeg-batch-converter/575073) I have decided to make available my x264 presets for VidCoder that have taken me so long to come up with, but which will 99.9% do away with all your transcoding issues slight_smile There are many Handbrake/VidCoder presets and settings sprinkled throughout the Plex forums and the internet for that matter. What makes these presets different? Why would I not just use the normal encoder “Preset” and “Tune…

---

<div class="post-metadata">

**Author:** ![Volts](https://avatars.discourse-cdn.com/v4/letter/v/a5b964/32.png) [@Volts](https://forums.plex.tv/u/Volts)\
**Post date:** [September 28, 2020, 3:55am UTC](https://forums.plex.tv/t/bizarre-pms-transcoding/637564/4 "2020-09-28T03:55:58Z")

</div>

Here’s a picture from that thread, because I like pictures.

This is an encoding without any buffer rate control performed. The peaks are 6x the average.

[![](https://global.discourse-cdn.com/plex/original/3X/2/f/2f5eff0716d51dd5e7c510f9af5846806c0013b6.png) ](https://global.discourse-cdn.com/plex/original/3X/2/f/2f5eff0716d51dd5e7c510f9af5846806c0013b6.png)

---

<div class="post-metadata">

**Author:** ![moondigger](https://avatars.discourse-cdn.com/v4/letter/m/838e76/32.png) [@moondigger](https://forums.plex.tv/u/moondigger)\
**Post date:** [September 28, 2020, 4:19am UTC](https://forums.plex.tv/t/bizarre-pms-transcoding/637564/5 "2020-09-28T04:19:16Z")

</div>

Volts – thank you for your quick reply.

Okay, so for many years I’ve been using the constant quality (RF) slider in Handbrake to try to strike a balance between file size and quality, coming down a little bit on the side of small file sizes because my server storage space was sort of limited.

A few months back I upgraded my storage such that I don’t have to be quite so careful about file size, and so I’ve been bumping the RF slider a little more toward the quality end, figuring bigger file sizes aren’t as worrisome as before. I was still checking the overall average bitrate with the idea that I wanted to keep the encoded files below 10 Mbps.

I guess that’s why I never noticed the ‘unnecessary’ transcoding behavior before – the RF slider was pushed just enough in the low file size direction that my peak bitrate was staying below 12 Mbps. But now that I’ve been bumping the RF slider in the other direction, the peaks are getting much higher than before, even as the averages are still alright.

Setting all that aside for a minute… it seems strange to me that Plex would use the peak transient bitrate to decide whether a file can be streamed without transcoding. If the overall average bitrate is well below the bandwidth limit, then certainly a modern client like the Apple TV 4K can handle buffering a direct play video enough to handle the transient peaks when they happen. Heck, you could pre-buffer the entire movie on that client if you wanted.

That said, it should be possible to use the constant quality slider in Handbrake, but set a hard upper limit for peak bitrate. I’ll have to dig into the advanced options, I guess…

---

<div class="post-metadata">

**Author:** ![Volts](https://avatars.discourse-cdn.com/v4/letter/v/a5b964/32.png) [@Volts](https://forums.plex.tv/u/Volts)\
**Post date:** [September 28, 2020, 4:46am UTC](https://forums.plex.tv/t/bizarre-pms-transcoding/637564/6 "2020-09-28T04:46:04Z")

</div>

> [@moondigger](#):
>
> If the overall average bitrate is well below the bandwidth limit, then certainly a modern client like the Apple TV 4K can handle buffering a direct play video enough to handle the transient peaks when they happen. Heck, you could pre-buffer the entire movie on that client if you wanted.

Yup.

Every device will download as fast as it can, as much as it can, until the buffer is full. That can be the entire movie. Or it can mean a turtle-and-hare race between download and playback. As long as the buffer bucket is never emptied, playback continues.

It’s not really about “modern”, except that “modern” is a proxy for “buffer size”. My TV has a big enough buffer that on lower-bitrate content, I can stop, upgrade, and restart my Plex Server without interrupting playback.

Plex knows that different clients have different buffer sizes, too. So at a given bandwidth, a specific video might work for one client (big buffer) but not for another (small buffer).

> [@moondigger](#):
>
> That said, it should be possible to use the constant quality slider in Handbrake, but set a hard upper limit for peak bitrate. I’ll have to dig into the advanced options, I guess…

It’s called “CRF+VBV”. Look at `vbv-maxrate` and `vbv-bufsize`.

And it’s exactly the recommended approach. Not just by me! Or @plexyChip from that thread! It’s what the Plex Optimizer presets use, too. And the x264 & x265 codec devs specifically recommend it for streaming.

---

<div class="post-metadata">

**Author:** ![moondigger](https://avatars.discourse-cdn.com/v4/letter/m/838e76/32.png) [@moondigger](https://forums.plex.tv/u/moondigger)\
**Post date:** [September 28, 2020, 4:58am UTC](https://forums.plex.tv/t/bizarre-pms-transcoding/637564/7 "2020-09-28T04:58:22Z")

</div>

Volts – Thank you! I guess I’m going to have to re-encode some movies. The bulk of my library is probably fine, at least judging by the half dozen or so older titles I’ve checked. It’s only the stuff I’ve encoded in the past few months that have such big peak requirements.

Based on a little bit of research, it looks like I can set vbv-maxrate to 14,000 without causing trouble for too many clients. If one of my family members is using a really old client, I’m okay with the server transcoding for them. But I’d like the bulk of what I’m serving to be direct play.

Thanks again for your help…

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 27, 2020, 4:58am UTC](https://forums.plex.tv/t/bizarre-pms-transcoding/637564/8 "2020-12-27T04:58:26Z")

</div>

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