Recommendation for Encoding Videos to Stream on my TV

Server Version#: 1.21.1.3830
Player Version#: Roku App

I appreciate anybody who is willing to lend me a helping hand here. I tend to think this is probably an easy question, but I am relatively new to this forum and having trouble finding the information on my own.

I am running Plex Media Server on a Synology Diskstation DS218+. The NAS is attached to my Verizon FIOS Router via a hard-wire. I have stored several home movies in MP4, MOV, and AVI format on the Diskstation, and am attempting to play them on Plex from my TCL 4K Roku TV, which is connected via Wi-Fi to the router. The DS is on the local network, so it shouldn’t matter but we have a Gigabit connection with Verizon and their top/newest router model. I can stream 4K content from the Roku store no problem, can watch things like The Mandalorian in high quality, all without issue on the TV.

I am running into the issue where 1080p and 4K videos buffer constantly, and sometimes I receive the “server not powerful enough” error on my TV. So watching even a 1 minute home video of my kids when they were babies is an exercise in frustration.

I have checked the Plex settings on my Roku TV, and I have it set for DirectPlay in Original Quality. The reason I have it set this way is because I was assuming that the TV would be able to handle these videos easily and I was trying to avoid any Transcoding happening on the Server.

However, since the videos buffer and I sometimes get the “server not powerful enough” error, I wonder if the TV is incompatible with the video files, and therefor causing the server to attempt to transcode beyond it’s capability. I am not sure if the buffering is happening because of file incompatibility that is causing the Server to Transcode (and it can’t keep up), or if maybe the TV itself is doing the Transcoding within the App (Sorry if that’s a stupid question), and the TV isn’t powerful enough. I sort of thought having a 4k TV would mean no transcoding was necessary, but clearly that must not be the case!

So my question is two fold -

  1. Is there a setting either on the Plex Media Server or the Plex App on Roku that can help me correct the situation? Something I can do to minimize the issue or something to check where I may have a setting that’s astray? I understand the basics but am no expert in codecs and transcoding.

  2. Assuming there’s no way to fix this in #1, short of buying new kit, I guess I have to re-encode all the videos on my server so that they wont’ transcode when playing on my TV. If that is the case, do you have any suggestions for picking a file format that will work well with my setup? I have Adobe Lightroom CC (which has basic support for encoding videos on Export), and Adobe Premier Elements that I can leverage to do the encoding. I just don’t know what format is most compatible with streaming to a 4k TV.

Again, thank you so much for your consideration and if you’ve read my entire post, for your time. Thank you and I am grateful for any pointers you may be willing to send my way.

James

So incredibly thankful. Thank you! I have downloaded Handbrake and already getting started.

Trumpy81 or anybody else who is willing to lend a helping hand,

Do you have any suggestions for 4K Resolution that will still avoid buffering on my setup? I followed the steps provided for Fast 1080p encoding by Trumpy, above, and this had great success.

However I tried encoding some of my 4K videos and keeping them 4K, but they will still buffer.

I guess I don’t understand why I can watch 4K on Netflix over my slow internet connection, but I can’t watch my home videos over the comparably faster intranet. I’m wondering if there are certain settings within HandBrake that will keep the resolution 4K but get the file size adequate enough for streaming to my Roku TV.

Thanks all, and happy holidays. If you didn’t guess, I am trying to stream home videos of my children to enjoy over this unique holiday of being mostly indoors.

James

I agree with everything you said, except this.

Fast Decode shouldn’t be necessary for any device that supports Main profile or is remotely modern. It both increases file size and decreases output quality. It’s not used by the Plex Transcoder or Optimizer jobs. I would recommend not checking Fast Decode.


4K content is more complicated. It generally should use H.265 instead of H.264.

What’s the source of your 4K media - UHD Blu-ray (possibly with HDR?) Or personally recorded videos?

Thank you for your reply!

The source content is home videos recorded on cell phones or my dslr. They are 4k resolution in varying formats.

I was hoping to retain the 4k resolution to stream to my 4k TV (TCL roku TV with plex app). Trumpys suggestions above worked great for my 1080p and below videos, but I’m still buffering 4k content.

I realize I’m no expert in this and that my NAS isn’t the most powerful. I was hoping to encode the videos in a format that could direct play to the TV. I don’t understand when they buffer if it’s an issue with transcoding by the Nas or bandwidth. If it’s just bandwidth, I’m wondering if there are settings in handbrake to achieve better compression but keeping the 4k resolution and general quality higher than 1080p.

When I find a profile that works, I will wind up running this in batch over a home movie collection of around 1500 mostly 1min clips.

Thank you!

Thank you all for your thoughtful replies. Any comment on if 4k can be achieved in the current setup to limit buffering?

Thanks Trumpy81, Appreciate it.

So if I keep it 4k resolution in Handbrake, there are no additional settings that will make a material difference in the stream quality?

Beginner question here, but why can I stream 4k from Netflix without any problems, but I can’t play a 4k video sitting on my media server on my local network? If I am playing the H.264 video on my TCL Roku TV, I would hope that it isn’t transcoding.

Thank you! Awesome help. Thanks

Fast Decode does make decoding simpler, but not through optimization. It disables several H.264 features and lobotomizes x264.

  • Disables CABAC. This is a significant H.264 performance feature and is the big step from the Baseline to Main profiles.
  • Disables the in-loop deblocker, a feature that reduces blocky visual artifacts during motion.
  • Disables B-frame weighting, another Main profile optimization.

Old devices like the iPod Classic or Android before Marshmallow didn’t support these features, but they didn’t support Main profile anyway.

Ok!

The impact of these H.264 features is well-supported by research. CABAC was included in H.264 to improve compression performance. Loop deblocking helps reduce visual artifacts that previous codecs suffered.

This first link is nice because you can see a few of the comparison tables:

A Practical Survey of H.264 Capabilities | Semantic Scholar

A few other references:

https://engineering.purdue.edu/~zhu0/ece634_s19/lecture/h264.pdf
A Practical Survey of H.264 Capabilities | IEEE Conference Publication | IEEE Xplore
Cost-effective scenarios of CABAC in H.264/AVC codec | IEEE Conference Publication | IEEE Xplore
Cabac Based Bit Estimation for Fast H.264 RD Optimization Decision | IEEE Conference Publication | IEEE Xplore
https://last.hit.bme.hu/download/vidtech/könyvek/Iain%20E.%20Richardson%20-%20H264%20(2nd%20edition).pdf (9.3.5)

Here’s an SSIM comparison I just generated. 15 second sample, 2000kbps. The only difference is Fast Decode. VMAF and PSNR results show similar gaps.

At RF22 the Fast Decode file is 15% bigger. Despite the additional bitrate, PSNR and SSIM still show a significant difference. A VMAF comparison shows that it partially catches up, but the worst frames are still much worse:

The difference is especially visible in water, trees or grass in the wind, or objects moving in front of other textured objects.

Here is a comparison using 100kbps to exaggerate problems. Fast Decode is on the right, and significant blocking artifacts are visible. The Jellyfish shouldn’t have right angles or brittle tendrils.

Video: sbs.mp4.gz (5.3 MB)

Screenshot:


The larger files produced by Fast Decode may hurt streaming performance, especially for mobile devices or remote users with limited bandwidth.

It doesn’t improve Direct Play or Stream compatibility for 1080p+ set-top-boxes, or for recent mobile devices. It could help a limited software decoder, but I don’t think that typically applies to Plex players.

That all said, I’ve been wrong several times today. :slight_smile: I would be interested in details or a demonstration of it helping.

I agree. Don’t use 4K media unless you can Direct Play/Stream it.

I was surprised to see a few Plex clients recently got 4K quality options, and Plex will gamely try to transcode to them. Check out this craziness - Plex transcoding to 4K:

plex 87535 137.5 10.5 1147688 863560  -  RNJ  20:01    0:23.26 /usr/local/share/PlexMediaServer-1.21.2.3841-8ae5668bf/Plex Transcoder -codec:0 hevc -codec:4 ac3 -analyzeduration 20000000 -probesize 20000000 -i /path/movies.test/Gemini.Man.2019.2160p.BluRay.REMUX.HEVC.DTS-HD.MA.TrueHD.7.1.Atmos.mkv -filter_complex [0:0]scale=w=3840:h=2160[0];[0]format=pix_fmts=yuv420p|nv12[1] -map [1] -metadata:s:0 language=eng -codec:0 libx264 -crf:0 22 -maxrate:0 37199k -bufsize:0 74398k -r:0 59.939999999999998 -preset:0 veryfast -x264opts:0 subme=0:me_range=4:rc_lookahead=10:me=dia:no_chroma_me:8x8dct=0:partitions=none -force_key_frames:0 expr:gte(t,n_forced*1) -filter_complex [0:4] aresample=async=1:ocl='5.1':rematrix_maxval=0.000000dB:osr=48000[2] -map [2] -metadata:s:1 language=eng -codec:1 ac3 -b:1 390k -segment_format mpegts -f ssegment -individual_header_trailer 0 -segment_time 1 -segment_start_number 0 -segment_copyts 1 -segment_time_delta 0.0625 -segment_list http://127.0.0.1:32400/video/:/transcode/session/52CC5AA8-4C04-4661-A7AC-F7538AB7D286/7b091701-88e6-4311-af39-7dbaf653bb99/seglist?X-Plex-Http-Pipeline=infinite -segment_list_type csv -segment_list_size 5 -segment_list_separate_stream_times 1 -segment_list_unfinished 1 -max_delay 5000000 -avoid_negative_ts disabled -map_metadata -1 -map_chapters -1 media-%05d.ts -start_at_zero -copyts -vsync cfr -y -nostats -loglevel quiet -loglevel_plex error -progressurl http://127.0.0.1:32400/video/:/transcode/session/52CC5AA8-4C04-4661-A7AC-F7538AB7D286/7b091701-88e6-4311-af39-7dbaf653bb99/progress

My :turtle: server isn’t fast enough to actually do it, and I doubt a DS218+ is either. And yeah, what’s the point, if you can’t Direct Play/Stream.

Do you mean H.265 here?

4K is strongly associated with H.265, and many consumer devices only support 4K when it’s H.265 - not H.264. I don’t think it makes sense to produce 4K H.264 files.

I agree it’s craaaazy slow to encode.

1 Like

Cheers and Merry Christmas!

It was an excuse to get my video quality metrics stuff working again, to prove to myself I wasn’t just spouting bullshit, and a way to procrastinate from wrapping presents. Time wasted? Time enjoyed.

:star2: :star2: :star2:

I agree on not procrastinating.
As for the spouting part? :thinking:

:rofl:

Merry Christmas

1 Like

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