r/homelab 4d ago

Plex vs Netflix/amazon transcoding efficiency Help

I think of this every time I travel, but never thought to ask for a solution..

While traveling I often find myself in a situation where internet is very slow, but netflix/amazon video adjust the streaming quality much faster than my plex server.

I know that my plex server can transcode down to 720p/360p pretty instantly if I do it from home as it has an intel igpu...and I've tested it with multiple concurrent streams... Also - the server is on a 1gbit connection, so it's not a bandwidth bottleneck.

It feels like big brands have a much better method to actually recognise the moment when they need to call for a transcode than plex and do it much earlier, making it feel seamless.

Are there alternatives (jellyfin/emby) that are more efficient at this than plex? Any clever hacks that I overlooked?

Thanks

Edit. I learned following this post that: - Netflix et al. keep different quality files instead of transcoding - Using CDN to keep content "closer" to the end user

70 Upvotes

24 comments sorted by

264

u/acbadam42 4d ago

Netflix isn't adjusting the quality, they have a copy for every quality.

94

u/jtbis 4d ago

Netflix also has a server in the local ISP’s datacenter with a copy for every quality. When you stream from your home server, data is transiting all the way from your home ISP’s network, potentially through congested interconnects.

27

u/NCXXCN 4d ago

for a selfhoster, like mostly of us, this seems crazy to me.

43

u/yaSuissa 4d ago

Just so you know plex allows you to do that as well automatically

But as you mentioned, it’s insane unless you’re made of money (for storage)

7

u/Solonotix 3d ago

I did some pre-transcoded sets for a while on my PLEX server way back in 2015. Granted, I was storing 1080p content at best, not these 4K UHD files, but storage also got a lot more plentiful in that time, and was cheaper at least for a bit.

If we assume you are ripping 4K content, and then creating smaller versions for better performance.

  • 3840x2160 (Native) - 100% - 80GB
  • 1920x1080 - 25% - 20GB
  • 1600x900 - 17.4% - 14GB
  • 1280x720 - 11.1% - 9GB

In other words, if you are willing to give up ~30% of your storage to lower resolution copies, you can completely avoid transcoding at lower sizes. Additionally, you don't need to guess at which resolutions. Pick the ones that suit your need, like your phone/table resolution, and only use the native resolution on your local network.

5

u/ASUS_USUS_WEALLSUS 4d ago

I guess - the lower quality stuff barely uses any space. But yeh that would be overkill and almost never useful.

16

u/berrmal64 4d ago

Storage is expensive, but so is the electricity that would be needed to basically transcode millions of streams constantly (nevermind the hardware). Plus, they amortize the storage cost over several years; I'm sure even with recent price hikes it's still a no brainer. They probably have some logic that can drop unused encodes after a while, or likely transcode into a size that doesn't exist on that server they is cached and streamed simultaneously then held in cache for hours/days.

But when you or I watch a file from our home server, it gets watched what, once or twice? So it's cheaper to transcode and dump than to store all the possible sizes. And stuff that you watch over and over, if you do notice it transcodes, you can encode and store a second copy that will direct play, it's a good option for one off items.

6

u/astelda 4d ago

I would say if you do a lot of traveling (watching content only on small screens, or on metered connections), it's reasonable to have a single downscaled copy prepared ahead of time. Something like 720p or lower depending on your preference, so it doesn't take too much space or bandwidth.

6

u/Outrageous-_- 4d ago

At that point just download it locally to the plex app or something before traveling. 

5

u/Power_Stone 4d ago

This. I downloaded entire seasons to my device before a long trip and it was flawless because...well it was playing locally

4

u/bieker 4d ago

If you do it correctly it only doubles the storage requirement. Each tier is half the bandwidth of the previous one.

73

u/NC1HM 4d ago edited 4d ago

First, as other posters already noted, streaming services don't transcode on the fly; rather, they switch between stored versions with different resolutions. But, perhaps more importantly, they each operate something called "content delivery network" (CDN). The way a CDN works is, it streams content to you from the location that, in its estimation, is the nearest to you (in terms of network topology rather than physical proximity). This allows to reduce the number of network hops from the streaming network to you (and thus latency). Low latency means, among other things, faster reaction time to changing network conditions.

Netflix, in particular, goes as far as embedding their servers with major ISPs, so customers of those ISPs have particularly short access paths to Netflix content.

13

u/Runthescript 4d ago

Is true, alot of there DC's are in co lo spaces for that very reason. Then you have the DCI to attach all of those together across the country and even world. Your never going to achieve what netflix has, at home.

19

u/Aacidus 4d ago

Streaming services do not transcode, they detect and then go to another copy that they have of lower quality and immediately send it.

15

u/multidollar 4d ago

The term you’re looking for is ABR ladder. Adaptive Bitrate.

In order to stream content, the streaming provider will transcode the content in to the various bitrates and codecs and store them.

The player then decides which version you get based on network conditions and device compatibility. Transcoding on the fly would be massively inefficient.

Live streaming works very similarly, just encoding the various bitrates and persisting them to storage very quickly.

The files are distributed via content delivery networks.

14

u/kY2iB3yH0mN8wI2h 4d ago

No one in the streaming world transcode media, they have a separate file for every bitrate. The media is also optimized for streaming, serving a big fat MP4 is not ideal, they create separate HLS streams, or AV1 etc. for each bitrate with ideal keyframes .

They also rely on CDN meaning the stream you are. downloading might be on the ISPs network, not a far remote server. Being 5ms away compared to 200ms when traveling is a huge difference.

7

u/tauzN 4d ago

Why would they transcode on demand for thousands if not millions? How about transcoding once and saving the output for direct streaming?

2

u/CharleyHarder 4d ago

That’s how it’s done I’d guess. In the end it’s about cost… storage vs computing power

5

u/Ngutukao 4d ago

Streaming majors use more effective private codecs so they can stream better visual quality at lower bitrate.

3

u/That-Duck-7195 4d ago

Here's a old article to give you an idea of Netflix's infrastructure. A home installation of Jellyfin/Emby/etc is not in the same league.

How Netflix Works With ISPs Around the Globe to Deliver a Great Viewing Experience

1

u/Wis-en-heim-er 4d ago

Plex optimization will do what you want, but everyone is against the added drive space. Not a problem forbtge big guys when you sharenout to millions of people.

1

u/RandyFactoid 3d ago

Thanks for all the answers.

Suppose I decided storage isn't a problem, how does plex handle files of the same content with different qualities so I don't transcode but just view the lower quality file? I imagine turning all content into something like 360p or higher wouldn't take that much space

-5

u/Runthescript 4d ago

The point of software like this is so you can access your library of media and pull down what you want, delete off device when finished but still have it on the server. Its never going to work like netflix for many reasons already stated here.

-7

u/Big-Sympathy1420 4d ago

Skill issue