Oldskooler Ramblings

the unlikely child born of the home computer wars

How to stream UHD 4K HDR rips to an LG C8 OLED via Plex

Posted by Trixter on April 29, 2022


(This was originally posted in an LG C8 owner’s thread, but once I saw that I was post #25529 in that thread, I figured almost nobody would see it. I’m posting it here in hopes that google will pick it up and help other LG C8 owners.)

I love HDR/DolbyVision on my LG C8, and I love streaming media to it from Plex.  After I had enough UHD movies on disc, I bought a UHD drive for my desktop PC to rip my UHD movie collection to my Plex server.  The ripping went fine, and plex can properly stream UHD HDR content to the C8 (and can even tonemap it for my older SDR displays), but some movies would pause a few times during playback for several seconds, and a few would pause every 5 to 10 seconds, making them unwatchable.  (Everything else, including full blu-ray rips, stream perfectly.)

My first thought was that the network connection to the TV wasn’t fast enough.  I started out on the 100mbps wired ethernet connection on the C8, then switched to wireless, then even an ethernet-to-USB adapter on the recommendation of this video:

…and while all of these switches got me faster speeds, UHD movies still stuttered when streamed.

I have a background in digital video compression, as well as unix, so I wrote some scripts to use ffprobe (part of ffmpeg) to figure out what the average and peak bitrates of UHD rips were.  The average video bitrates in my collection ranged from 34mbps (The Martian, 2015) all the way up to 85mbps (The Thing, 1982).  These were well below my networking speeds, so the network was not the culprit.  I then thought my Plex server was an issue, so I used the Plex Dashboard to see what its sending bitrate speeds were, and it didn’t have any trouble either (and the server wasn’t using any CPU because it didn’t need to transcode; the LG C8 decodes h.265 + bt.2020 + HDR in hardware).

Finally, I decided to probe the TV itself:  I transcoded a problematic UHD rip to SDR 4k h.264, at the same bitrates as the original, and streamed that… and it streamed fine with no pausing.  My conclusion: The LG C8 can only decode h.265 content roughly up to 60mbps.  Anything more demanding and it falls behind.

My solution for working around this:  Encode slightly lower-bitrate “proxies” to sit alongside the originals in Plex.  I have an RTX 3080 in my desktop PC, and it can decode/encode 4k h.265 faster than realtime, so I came up with this batch file in Windows:

REM LG C8 TV can't handle HDR streams with bitrates over 60mbps streamed
REM over any network device (chip limitation, not network limitation).
REM This creates a Plex Versions proxy that preserves as much quality
REM as possible without exceeding an LG C8's capabilities.
REM Call this batch file from the plex directory containing your main movie.
REM
REM The 120M bufsize represents a 3-second window @ 40M vbr that the max of 60M
REM can be sustained.
REM

mkdir "Plex Versions\LG C8"

for %%a in ("*.*") do ffmpeg -find_stream_info -hwaccel auto -i "%%a" -map 0 -c copy -c:v hevc_nvenc -pix_fmt p010le -tune:v hq -preset:v p7 -color_primaries bt2020 -color_trc smpte2084 -colorspace bt2020nc -spatial_aq:v 1 -temporal_aq:v 1 -b_ref_mode middle -profile:v main10 -tier:v high -b:v 40M -maxrate:v 60M -bufsize:v 120M "Plex Versions\LG C8\%%~na.mkv"

The above batch file uses the highest quality encoding settings for the NVENC block on my RTX 3080, uses an average and maximum bitrate that stays within the C8’s limits, and also preserves all of the HDR info.  Now, when I stream a UHD rip using Plex to my LG C8, if it starts to stutter and pause, I switch to the lower-bitrate proxy to finish out the movie.

The only question I’ve gotten is “don’t the RTX 3080 NVENC transcodes look terrible?”  Since I use a high bitrate for the transcodes, and NVENC’s hq settings, most of them look nearly identical.  I noticed a very, very slight lack of texturing in building walls during the latter third of Saving Private Ryan, as those scenes have fine texture, lower light, and lots of film grain.  But even if there’s a tiny loss of quality, it still beats the same movie’s blu-ray rip by a wide margin.

Not all of my UHD rips pause when playing. But now, if one starts to pause, I can just switch to the proxy and avoid getting off the sofa, fumbling around with discs, etc.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

 
%d bloggers like this: