HEVC cpu 100%, H264 cpu 10% - WHY?

There’s a huge problem with stuttering and performance on some TV shows from Sonarr. But I think I found the issue. I’ve watched the dashboard and there’s a ton of cpu used for shows with codec HEVC versus very little for codec H264.

Why is HEVC so cpu intensive, how can I prevent it, and is there a setting in Sonarr that I should be using?

ImageCapture019
ImageCapture014

HEVC (H265) is a more advanced compression technique. It is VERY CPU intensive process to turn HEVC back into working video.

If you have a device capable of decoding HEVC video, things work great. It’s starting to be popular because it is capable of smaller filesizes for the same video quality.

If your device is not capable of real-time HEVC, your device will slam to a halt. What device are you using? Try to avoid HEVC or X265.

My server is on an Intel NUC i7, not running much of anything else. Amazing that it can’t handle the job with less cpu usage. So, is there a way to pre-convert the hevc to h264? Or a way to tell Sonarr I don’t want that format?

I don’t use or know how Sonarr works (I need to, one of these days…). I’d assume you can specify the video CODEC you prefer. H/X264 is retroactively known as AVC, while the newer H/X265 is called HEVC. In my file sources, I’ve seen both x265 or HEVC to describe the format, but almost universally x264 or h264 for the codec for the former. If Sonarr offers an option, check the video codecs and disable anything x265 or HEVC.

What is the device you are playing these videos on? If you can avoid transcoding, then your server’s CPU won’t budge an inch on serving the file.

Do you know if the Simpsons file is being transcoded when playing? Check the dashboard of plex (click the “Activity” icon in the upper right when someone is watching) to see if it says the file is being direct-played, or transcoded. If the file is being directly played, then the server does no transcoding, and the CPU sits idle.

What you’re using to play the files is the important part. Is the NUC the server and the player?

If the NUC is what you’re using to play the files it should do that fine. Are you possibly using a browser to access Plex to play these files on the NUC?

Some browsers do not like HVEC and can also be picky about what kind of audio they will direct play

If this is the case, I suggest you try a different browser, Plex for Windows app or HTPC

Avoiding HVEC might be possible on Sonar but it’s going to be harder and harder to avoid moving forward, and really shouldn’t be necessary

It appears the problem is pretty much when using a browser (both Chrome & Firefox) away from the NUC server. They both do HEVC transcoding with 100% cpu and H264 in Direct Stream at 10%.
On the NUC server, I run HTPC client and it does HEVC both Direct Play AND Stream at 80% and H264 Direct Stream 60%.
On a client pc, I can run Plex App and HEVC runs Direct Play at 20%.
On a remote Roku stick, Plex runs HEVC Direct Stream using 10%!

So not surprising that a browser would be the worst, but I thought HTPC should have done better while running right on the server.

Amazingly, the Roku beats them all!

Which i7? If 7th gen or later, it should use the onboard QuickSync graphics for transcoding.

Use a Chromium based browser (Chrome, Edge), v107 or later. Chromium v107 added support for HEVC video.

Use https://app.plex.tv/desktop. Plex Web v4.94.2 added support for HEVC video. The bundled version of Plex Web does not yet support HEVC.

The video will still transcode if you need to fit under a bandwidth limit or burn subtitles.

I’m running Chrome v108 and it just does transcoding HEVC at 100%.

My experience with HEVC and Chrome is that it will direct play if the audio track is stereo AAC. If it’s another format (your screenshot says it’s AC3) both audio and video are transcoded. I really don’t use a browser for watching content, so there might be a way to configure it so it works. It just isn’t a priority for a browser to direct play for me.

Which i7?

Bundled Plex Web or app.plex.tv?

Also, check Settings → Plex Web → Debug + Show Advanced.
Make sure Direct Play and Direct Stream are both enabled.

Using app.plex.tv:

Screenshot (1570) Screenshot (1568)

Sorry, I had bad info. The server is actually an i5 (NUC5i5RYB), version H40999-504, and I can’t find that model isn’t even listed on Intel’s site! I was showing the run from a app.plex.tv on Chrome from a workstation. Direct Play and Direct Stream were enabled.

Further issue is the Roku: with DP and DS enabled it was doing fine with a HEVC in Direct Stream. But yesterday I ran an H264 show and it Transcoded! I’m a real novice at all this video streaming and could use a good tutorial on what’s going on!

I have been experimenting on the Roku, and at times disable Direct Streaming which solved sync problems with audio/video. But in this run it was enabled.

How recently was that episode added? It may not have gone through deep analysis yet; it appears to be transcoding due to bandwidth perhaps.

Tech specs (PDF): https://www.intel.com/content/dam/support/us/en/documents/mini-pcs/nuc-kits/NUC5i5RYB_NUC5i3RYB_TechProdSpec.pdf

That NUC has an i5-5250U or i5-5257U CPU.

The QuickSync graphics (embedded GPU) in 5th gen Intel CPUs does not support decoding of HEVC video. It does support decoding of H.264/AVC, MPEG2, & VC1 video.

Therefore, when transcoding HEVC video, Plex will use the CPU to decode the video.

That is why the CPU hits 100% when transcoding HEVC video but only 10% when transcoding H.264 video.

Ok, but why is it transcoding the H264 now? That show downloaded on 12/08, three days before I played it, and it still is doing transcoding & buffering now. How long should it take to do this deep analysis and how can I tell if it’s been done?

Is my only solution to buy a new NUC? Interestingly, playing the file on Windows 10 browsers shows it in Direct Play. Why not on the Roku?

You can can see if deep analysis has been performed by examine the episode’s XML info; look for the “deepAnalysisVersion” and “requiredBandwidths” listings. If present, deep analysis has been performed.

Without deep analysis, Plex falls back to other methods of determining the maximum bandwidth required by a stream. I’m not saying this definitely the problem here, but it’s suspicious that it’s showing a bandwidth of 10Gbps for that stream.

deepAnalysisVersion=“6” requiredBandwidths=“5604,5560,5512,5512,5512,5512,5512,5512”

Is that for the same episode you show in the screenshot above? If so, can you post the full XML info for it?

<MediaContainer size="1" allowSync="1" identifier="com.plexapp.plugins.library" librarySectionID="2" librarySectionTitle="TV Shows" librarySectionUUID="6f64663d-97dc-4786-a14f-3243bf1f89d8" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1667299190">
<Video ratingKey="130077" key="/library/metadata/130077" parentRatingKey="130076" grandparentRatingKey="130075" guid="plex://episode/638061d1b19ba8a5a331e584" parentGuid="plex://season/6386360f96b2fb5b9e076990" grandparentGuid="plex://show/638061d0b19ba8a5a331e514" type="episode" title="A Magical Place" titleSort="Magical Place" grandparentKey="/library/metadata/130075" parentKey="/library/metadata/130076" librarySectionTitle="TV Shows" librarySectionID="2" librarySectionKey="/library/sections/2" grandparentTitle="Yellowstone: One-Fifty" parentTitle="Season 1" summary="Kevin Costner retraces the steps of the Hayden expedition as he explores the wildest terrain of Yellowstone National Park." index="1" parentIndex="1" viewOffset="190000" viewCount="1" lastViewedAt="1670871874" thumb="/library/metadata/130077/thumb/1670553733" art="/library/metadata/130075/art/1670553732" grandparentThumb="/library/metadata/130075/thumb/1670553732" grandparentArt="/library/metadata/130075/art/1670553732" duration="2557020" originallyAvailableAt="2022-11-20" addedAt="1670553730" updatedAt="1670553733">
<Media id="89370" duration="2557020" bitrate="10816" width="1920" height="1080" aspectRatio="1.78" audioChannels="2" audioCodec="aac" videoCodec="h264" videoResolution="1080" container="mkv" videoFrameRate="60p" audioProfile="he-aac" videoProfile="high">
<Part accessible="1" exists="1" id="90857" key="/library/parts/90857/1670076060/file.mkv" duration="2557020" file="D:\TV\Yellowstone - One-Fifty\Yellowstone - One-Fifty - 1x01 - A Magical Place WEBDL-1080p.mkv" size="1750297380" audioProfile="he-aac" container="mkv" deepAnalysisVersion="6" requiredBandwidths="5604,5560,5512,5512,5512,5512,5512,5512" videoProfile="high">
<Stream id="81592" streamType="1" default="1" codec="h264" index="0" bitrate="5344" language="English" languageTag="en" languageCode="eng" bitDepth="8" chromaLocation="left" chromaSubsampling="4:2:0" closedCaptions="1" codedHeight="1088" codedWidth="1920" colorPrimaries="bt709" colorRange="tv" colorSpace="bt709" colorTrc="bt709" frameRate="59.940" hasScalingMatrix="0" height="1080" level="42" profile="high" refFrames="3" requiredBandwidths="5475,5432,5384,5384,5384,5384,5384,5384" scanType="progressive" width="1920" displayTitle="1080p (H.264)" extendedDisplayTitle="1080p (H.264)"> </Stream>
<Stream id="81594" streamType="2" selected="1" default="1" codec="aac" index="1" channels="2" bitrate="128" language="English" languageTag="en" languageCode="eng" audioChannelLayout="stereo" profile="he-aac" requiredBandwidths="128,128,128,128,128,128,128,128" samplingRate="48000" title="English AAC 2.0ch 128kbps 48.0kHz" displayTitle="English (HE-AAC Stereo)" extendedDisplayTitle="English AAC 2.0ch 128kbps 48.0kHz (Stereo)"> </Stream>
<Stream id="81593" streamType="3" codec="eia_608" index="0" bitrate="5344" language="English" languageTag="en" languageCode="eng" embeddedInVideo="1" requiredBandwidths="5475,5432,5384,5384,5384,5384,5384,5384" displayTitle="English (Closed Captions)" extendedDisplayTitle="English (Closed Captions)"> </Stream>
<Stream id="81595" streamType="3" codec="srt" index="2" bitrate="0" language="English" languageTag="en" languageCode="eng" requiredBandwidths="1,1,1,1,1,1,1,1" title="English" displayTitle="English (SRT)" extendedDisplayTitle="English (SRT)"> </Stream>
</Part>
</Media>
<Guid id="tmdb://4069950"/>
<Guid id="tvdb://9468308"/>
<Marker id="8549" type="intro" startTimeOffset="1609" endTimeOffset="89349">
<Attributes id="8549"/>
</Marker>
<Extras size="0"> </Extras>
<Related> </Related>
</Video>
</MediaContainer>

Thanks. Do you have an example (from the same series, in H.264) which does not transcode?

All 4 episodes I have in that particular series transcode. I have another “related” series here that is also H.264 but it does Direct Stream on the Roku and plays well. Here’s the xml for it:

<MediaContainer size="1" allowSync="1" identifier="com.plexapp.plugins.library" librarySectionID="2" librarySectionTitle="TV Shows" librarySectionUUID="6f64663d-97dc-4786-a14f-3243bf1f89d8" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1667299190">
<script/>
<Video ratingKey="129860" key="/library/metadata/129860" parentRatingKey="129485" grandparentRatingKey="129484" guid="plex://episode/628651d8f403942cc295a6e2" parentGuid="plex://season/628569e13fcd144dcb17d54c" grandparentGuid="plex://show/5d9c08de08fddd001f2a3040" type="episode" title="One Hundred Years Is Nothing" grandparentKey="/library/metadata/129484" parentKey="/library/metadata/129485" librarySectionTitle="TV Shows" librarySectionID="2" librarySectionKey="/library/sections/2" grandparentTitle="Yellowstone (2018)" parentTitle="Season 5" contentRating="TV-MA" summary="John Dutton is sworn in as Governor of Montana. As John settles into the powers of his new office, he makes bold moves to protect the Yellowstone from his opponents. The bunkhouse and the Duttons enjoy the Governor's ball." index="1" parentIndex="5" audienceRating="8.0" viewOffset="98000" skipCount="1" lastViewedAt="1670873976" year="2018" thumb="/library/metadata/129860/thumb/1669903079" art="/library/metadata/129484/art/1668398955" parentThumb="/library/metadata/129485/thumb/1668450360" grandparentThumb="/library/metadata/129484/thumb/1668398955" grandparentArt="/library/metadata/129484/art/1668398955" grandparentTheme="/library/metadata/129484/theme/1668398955" duration="3845920" originallyAvailableAt="2022-11-13" addedAt="1669833506" updatedAt="1669903079" audienceRatingImage="themoviedb://image.rating">
<Media id="89234" duration="3845920" bitrate="9546" width="1920" height="1080" aspectRatio="1.78" audioChannels="6" audioCodec="eac3" videoCodec="h264" videoResolution="1080" container="mkv" videoFrameRate="24p" videoProfile="high">
<Part accessible="1" exists="1" id="90718" key="/library/parts/90718/1668434594/file.mkv" duration="3845920" file="D:\TV\Yellowstone (2018)\Season 5\Yellowstone (2018) - 5x01 - One Hundred Years Is Nothing WEBRip-1080p.mkv" size="4590290222" container="mkv" deepAnalysisVersion="6" requiredBandwidths="10449,10350,10248,10097,9998,9900,9782,9782" videoProfile="high">
<Stream id="81184" streamType="1" default="1" codec="h264" index="0" bitrate="8906" bitDepth="8" chromaLocation="left" chromaSubsampling="4:2:0" codedHeight="1088" codedWidth="1920" colorPrimaries="bt709" colorRange="tv" colorSpace="bt709" colorTrc="bt709" frameRate="23.976" hasScalingMatrix="0" height="1080" level="40" profile="high" refFrames="4" requiredBandwidths="9809,9709,9608,9457,9357,9259,9143,9143" scanType="progressive" width="1920" displayTitle="1080p (H.264)" extendedDisplayTitle="1080p (H.264)"> </Stream>
<Stream id="81187" streamType="2" selected="1" codec="eac3" index="3" channels="6" bitrate="640" language="English" languageTag="en" languageCode="eng" audioChannelLayout="5.1(side)" requiredBandwidths="640,640,640,640,640,640,640,640" samplingRate="48000" displayTitle="English (EAC3 5.1)" extendedDisplayTitle="English (EAC3 5.1)"> </Stream>
<Stream id="81185" streamType="3" codec="srt" index="1" bitrate="0" language="English" languageTag="en" languageCode="eng" requiredBandwidths="1,1,1,1,1,1,1,1" displayTitle="English (SRT)" extendedDisplayTitle="English (SRT)"> </Stream>
<Stream id="81186" streamType="3" codec="srt" index="2" bitrate="0" language="English" languageTag="en" languageCode="eng" requiredBandwidths="1,1,1,1,1,1,1,1" title="SDH" displayTitle="English (SRT)" extendedDisplayTitle="SDH (English SRT)"> </Stream>
</Part>
</Media>
<Director id="75521" filter="director=75521" tag="Stephen T. Kay"/>
<Writer id="74812" filter="writer=74812" tag="Taylor Sheridan"/>
<Guid id="imdb://tt17663758"/>
<Guid id="tmdb://3728887"/>
<Guid id="tvdb://9171965"/>
<Rating image="themoviedb://image.rating" value="8.0" type="audience"/>
<Role id="73114" filter="actor=73114" tag="Kylie Rogers" tagKey="5d776a77fb0d55001f546d54" role="Young Beth" thumb="https://metadata-static.plex.tv/a/people/a137e1a2ff96c6ec92cd36c2747ad00c.jpg"/>
<Role id="73137" filter="actor=73137" tag="Kyle Red Silverstein" tagKey="5d776927594b2b001e69e76e" role="Young Rip" thumb="https://image.tmdb.org/t/p/original/mywgXyUyrCSnS597TGV51ZotFo7.jpg"/>
<Role id="73115" filter="actor=73115" tag="Q'orianka Kilcher" tagKey="5d7768378a7581001f12d970" role="Angela Blue Thunder" thumb="https://metadata-static.plex.tv/8/people/813ffbea9698466d7688f5bc60569416.jpg"/>
<Role id="73124" filter="actor=73124" tag="Buck Taylor" tagKey="5d7768307e9a3c0020c6bd68" role="Emmett Walsh" thumb="https://metadata-static.plex.tv/people/5d7768307e9a3c0020c6bd68.jpg"/>
<Role id="73143" filter="actor=73143" tag="Jacki Weaver" tagKey="5d7768364de0ee001fccbc36" role="Caroline Warner" thumb="https://metadata-static.plex.tv/2/people/26e719ea85c0f61cca990ec94d19655c.jpg"/>
<Role id="73096" filter="actor=73096" tag="John Emmet Tracy" tagKey="5d776987f617c90020161023" role="Ellis Steele" thumb="https://metadata-static.plex.tv/people/5d776987f617c90020161023.jpg"/>
<Role id="73080" filter="actor=73080" tag="Jake Ream" tagKey="5e164f13bc1372003ea84305" role="Jake"/>
<Role id="73093" filter="actor=73093" tag="Ethan Lee" tagKey="5e164b4ecd0850003b773848" role="Ethan"/>
<Role id="73222" filter="actor=73222" tag="Kai Caster" tagKey="5d77689fad5437001f74b31d" role="Rowdy"/>
<Role id="73086" filter="actor=73086" tag="James Jordan" tagKey="5d776a7996b655001fdef839" role="Livestock Agent Hendon" thumb="https://metadata-static.plex.tv/9/people/998609731aa39d0facdae06ae976f451.jpg"/>
<Role id="74813" filter="actor=74813" tag="Forrest Wilder" tagKey="5e16572661c6140040d8e7f3" role="Young Lloyd"/>
<Role id="75509" filter="actor=75509" tag="Matthew Downs" tagKey="5e163bfb2d4d84003e4973d5" role="Trooper Mark Rigby" thumb="https://metadata-static.plex.tv/9/people/9903a313e4d8c384ace1cccef08626e0.jpg"/>
<Role id="75522" filter="actor=75522" tag="Vince Duvall" tagKey="63737fc999ac6d371a4e2ce9" role="Scott McMullen"/>
<Role id="74814" filter="actor=74814" tag="Lainey Wilson" tagKey="63737fc9bcf22f2e9db8a05a" role="Abby"/>
<Role id="75523" filter="actor=75523" tag="Alex Mortensen" tagKey="609aabdbcbd393002c9ac861" role="Stetson" thumb="https://metadata-static.plex.tv/b/people/b7b48ff905145d1d0fdbc721e74177cf.jpg"/>
<Role id="75524" filter="actor=75524" tag="Stephen Fuller Austin" tagKey="632095fc35207c7911d429d8" role="Supreme Court Justice"/>
<Role id="75525" filter="actor=75525" tag="Brian Carlson" tagKey="5d9f3d07ca3253001ef319ff" role="Anchorman"/>
<Role id="75526" filter="actor=75526" tag="Surae Chinn" tagKey="63737fc86bfc9e7e621516f4" role="Anchorwoman"/>
<Role id="75527" filter="actor=75527" tag="Clark Moore" tagKey="5d7768929ab54400214e7ec0" role="Canadian Captain" thumb="https://metadata-static.plex.tv/a/people/a03799174436857d0dc107a227db1478.jpg"/>
<Role id="75528" filter="actor=75528" tag="T.J. Knutson" tagKey="63737fc99dbee1eebb5d6fc1" role="Austin"/>
<Role id="75529" filter="actor=75529" tag="Kevin Hager" tagKey="5d776b7496b655001fe118ba" role="Bartender"/>
<Role id="75530" filter="actor=75530" tag="Chris Marroy" tagKey="5d776a5e9ab54400214fe5e2" role="Waiter"/>
<Role id="75531" filter="actor=75531" tag="Trevor Snarr" tagKey="5d776832f54112001f5bd011" role="Old Cowboy"/>
<Role id="75532" filter="actor=75532" tag="Stetson Owen" tagKey="63737fc9f8d8e09441a0085e" role="Cowboy"/>
<Role id="75533" filter="actor=75533" tag="Sibley Snowden" tagKey="63737fc961bb95d05010339c" role="National Anthem Singer"/>
<Role id="75534" filter="actor=75534" tag="Derek Lacasa" tagKey="5e16460b10faa500400eb2f9" role="Weary Man"/>
<Role id="75535" filter="actor=75535" tag="Richard Bucher" tagKey="5d7768507228e5001f1e1ee9" role="Bandit"/>
<Marker id="8549" type="intro" startTimeOffset="97306" endTimeOffset="162268">
<Attributes id="8549"/>
</Marker>
<Extras size="0"> </Extras>
<Related> </Related>
</Video>
</MediaContainer>