Less CPU-intensive downscaling possible?

Currently, streaming a variety of 1080p (~8GB to 15GB MKV H.264) videos at 4Mbps 720p make my server's Intel Core i5 2.8GHz CPU cry. By cry, I mean 80-90% CPU usage with no breaks between. Adjusting the server's transcoder settings (e.g. "Make My CPU Hurt" etc..) don't seem to have much (if any) of an effect.

 

I assume downscaling is the reason. By comparison though, upscaling 720p to 1080p only requires about 20% CPU time. Additionally, a straight 720p to 720p stream re-encoded purely for bitrate to a Roku or something seems similarly CPU friendly.

 

I can appreciate that real-time transcoding is extremely demanding, but I'd like to ask: is there room for improvement here? Can the downscaler be further optimized to reduce CPU usage? Maybe by some trade off in quality through approximation or another set of tricks? Or is it doomed to always be taxing? ... or do I have another problem?

I know this will not be much help to you but I have been there too. My Plex server at home runs on an AMD 4 core (Already on a loser as AMD's suck at transcoding other than their more recent CPU's).

I share my library with a couple of friends but it would make my server crash usually. Especially if they watched a 1080. It was pretty much at the point that I was going to tell them it would have to stop.

Then two things happened. Firstly I switched my seedbox to a dedicated server and installed Plex. (So now i have two servers) The Online server runs a Xeon Quad and i hammered it with 4 1080's streaming to different devices making sure each was forced to transcode. There was barely a murmur when i RDP'd into the server to monitor the CPU. As in overall cpu would occasionally jump as high as 60% then stay at around 10% for 50 seconds or so before hitting 60% again for a fraction of a second. So definitely the better the CPU the better the results.

This all happened two days before the latest update. Since the update... with transcoding set to auto, im finding that 80% of files will now direct play to their clients. That's a Samsung Bluray and a chromecast. If they use their WP8 or iPad clients then it transcodes especially the WP8. 

Anyway the online server isn't any sort of solution for me. Just a short term way of seeing what sort of CPU will be going in my next (overdue) build of my main server, 

 Defintely a http://www.cpubenchmark.net/cpu.php?cpu=Intel+Xeon+E3-1245+V2+%40+3.40GHz or something with a similar score on CPU benchmark.

What Core i5 do you have ? Sandy, Ivy or Haswell ?

I have a Haswell i5 4570 and have NO problems at all with transcoding (default settings) 

My system can handle about 10 simultaneous transcodes in any combination - my upload can't though.   

AFAIK, there is no "Upscaling" in Plex.  If video is 720p, and you request 1080p, you will get 720p.  The 720p video may still need to be transcoded, or, if Plex believes it fits the criteria of your device/bandwidth, it will be sent unmodified.

"Prefer High Speed Transcoding" will decrease CPU use AFTER "Transcoder Default Throttle Buffer" (default of 60 seconds) has been reached.  So, if the throttle buffer is 60 seconds, your CPU use will hit 100% until 60 seconds of the video has been transcoded, then it will periodically spike CPU use to keep the buffer full.  ("Prefer High Quality" and "Make My CPU Hurt" are probably more than your i5 can handle.  They will increase quality for streaming to remote bandwidth constrained devices or decrease file size for syncing, but require a fast CPU.  Don't use them if you're having performance issues.)

Exactly what i5 do you have?  Also, check the venting/cooling of your i5/server.  The CPU will run at a slower speed to prevent overheating, so if the i5's heatsink/fan is obstructed, you'll end up with what appears to be high CPU use, even for mundane tasks.

The only way to lower CPU use is to lower quality of the transcoder.  It could be an interesting feature/option for Plex to have a "Only use high CPU transcode settings for Sync and bandwidth constrained transcodes" -- the problem is that what qualifies as "bandwidth constrained" is subjective, and varies from video to video.

Some good answers here, but I thought I would give a no nonsense answer to your original question: Yes, there is of course room for improvement. Lately there has been some work done on the transcoder, and more will likely happen in the future. But the actual concept of real time transcoding will always hurt CPU's. At least until we live in a potential future when a GPU can be utilised for that. But that will likely be a long time in the future due to various reasons.

Also, if you see very low CPU utilisation when the interface says it is transcoding, then it is only remuxing. Remuxing is a process were the container is being swapped to a container that the receiving device supports natively. For example, a MKV file can be remuxed into MP4 when an iPhone requests it IF the codecs inside the MKV is for example H264 and AAC (and maybe MP3 sound). If it is something else then PMS needs to transcode it instead of remuxing it.

early 2021 clean-up: implemented (transcoding settings)