logoalt Hacker News

corndogeyesterday at 8:28 PM4 repliesview on HN

From hosting a peertube instance solely for my own stuff for several years, I've come to appreciate just how difficult self hosting a streaming video platform is. As you say, bandwidth and storage requirements are significant; another less obvious one is transcoding. When a user uploads an HD video file, it needs to be transcoded into lower resolutions if you want there to be a hope of people streaming it. While Peertube itself is perfectly happy running on 2-4 vcpu cores on a cheap cloud vm, if you use those cores to handle transcode jobs it can take huge amounts of time (like 20+ hours) to transcode even medium length 1080p videos. So you really need either a lot of CPU that sits mostly idle, or hardware acceleration, both of which are expensive when purchased from cloud providers. Or you can use remote transcoding to offload transcode jobs onto your home gaming pc or whatever, which works well, but can be complicated and a bit touchy to set up properly, and now you have a point of failure dependent on your home network...

And then, people watching videos are used to the YouTube experience with its world class CDN infra enabling subsecond first frame latencies even for 4k videos. They go on Peertube and first frame takes like 5 seconds for a 1080p video...realistically, with today's attention spans most of them are going to bounce before it ever plays.


Replies

cataparttoday at 3:17 AM

Since you seem like you have practical knowledge here, I hope you don't mind me asking:

Would it change the equation, meaningfully, if you didn't offer any transcoding on the server and required users to run any transcoding they needed on their own hardware? I'm thinking of a wasm implementation of ffmpeg on the instance website, rather than requiring users to use a separate application, for instance.

Would you think a general user couldn't handle the workload (mobile processing, battery, etc), or would that be fairly reasonable for a modern device and only onerous in the high traffic server environment?

show 1 reply
Dylan16807today at 2:58 AM

I shove 1080p mp4s onto a very cheap server and I get 2 seconds of load time there versus somewhere between 1 and 2 seconds on youtube. And looking at network requests, the first chunk of the file loads in well under a second so I'd expect something with the metadata preloaded could start playing at that point. So if peertube takes 5 seconds, I really wonder why.

Is it inconvenient to transcode before/during upload?

show 1 reply
alisonatworkyesterday at 11:40 PM

The funny thing is that YouTube has now enshittified to the point where people routinely DO wait well over 5 seconds to watch the video they actually wanted to watch while interstitials and other commercials are jammed in. Even with adblock enabled, the latest YouTube code won't unlock the first frame of the actual video till some period of ad time has passed so you just sit there looking at a black screen. This on its own definitely isn't enough to get people to leave the platform, but it's still notable how much worse the experience has gotten compared to a few years ago.

show 1 reply
hsbauauvhabzbyesterday at 10:25 PM

What value do you get in transcoding your own stuff? I have plex transcoding disabled on all local network devices that stream it and run into minimal issues (codecs on TV devices, mostly).

show 1 reply