Ask HN: Anyone hosting their own videos?

37 points by worldofmatthew ↗ HN
Hello,

I am preparing to soon upload all new video's I produce on to my own website instead of a platform.

I am asking if there is any one else who has done such a thing, so that I can look into subscribing to their RSS feeds and having things to watch that are not hosted on YouTube.

67 comments

[ 3.6 ms ] story [ 21.8 ms ] thread
There's quite a few tech people using peertube as either the only or an alternative for hosting. You still need to host the original, but if people watch your stuff, maybe you'll save some bandwidth on the p2p distribution.
Peertube is often very hard to load within MPV and you are exposing all of the visitors IPs to each other.
That's the tradeoff. Who do you trust to be able to something nefarious with your data?

One random person on the internet being able to see 1% of the videos you watch (the ones where you peered with them) VS one giant conglomerate being able to see 100% of the videos you watch?

> you are exposing all of the visitors IPs to each other.

For whom it may concern: This would most likely be a violation of the GDPR for users from Europe. You'll have to state this in a cookie notice if you can't change it.

That notice is already built into peertube. It was mainly developed in France.
PeerTube shows a banner the first time you use it.
I just checked out your instance and the only time I saw a warning banner was a tiny little thing at the bottom of the screen when your video was already playing with me connected to 2 peers. No accept button, not even an opt out button.

Is that the stock install or did you add autoplay or something? I'm not sure I'd trust that to cover me under GDPR. It's a bit late by then.

Also doesn't GDPR require active opt-in consent rather than a "here's what we're doing" message? Seems a bit brittle.

That is stock install.

Anyway, from what I understand, the GDPR doesn't apply to my personal website because of https://gdpr.eu/recital-18-not-applicable-to-personal-or-hou...

I wasn't trying to catch you out fwiw, I was evaluating my own potential use of Peertube. I'll stick to YouTube for now, they've got a vested interest in not tripping over GDPR.

I'd definitely spend more time trying to custom build a consent interstitial than making videos haha

Installing peertube on my yunohost.org server was very easy thanks to the packaging provided. Joinpeertube.org can tell you more about the project. It is a social media project which means moderation is needed depending on how you choose to manage it.
Is this just about not being on YouTube or in general any platform? Otherwise I'd check out Vimeo for pure video hosting without the "social" part. There's a good reason that these platforms exist as they deal with all the encoding edge cases and different devices your users may use.
This. Not all video hosting platforms are social networks.

Vimeo (mentioned), JWPlayer, Mux, there's tons of options.

You could get away by hosting an mp4 file on S3, but you lose seeking, support for bandwidth-responsive quality/resolution, support for every device under the sun, and metrics.

And it may not be cheaper. I got a surprise AWS bill when someone hotlinked to test video files I was hosting so people can download them and use locally. That one oops could've paid for Vimeo Pro subscription for a lifetime.

Vimeo pivoted recentlish to big enterprise. They explicitly don't want smallish creators.
They have a "Starter" plan for $9/month and list "Small business" and "creative professionals" as their use cases. I wouldn't say they pivoted to big enterprise. They just pivoted to B2B in general and gave up on the consumer facing "indie-YouTube" side.
(comment deleted)
Just have to nitpick: videos. Plurals don't have an apostrophe.
OP might be dutch.

In dutch, nouns that end in the single vowels '–a', '-i', '-o', '-u', '-y' get a "-'s" when forming the plural. The apostrophe is added to keep the long single vowel at the end long.

That's why dutch speakers frequently make this mistake.

My own personal webpage, which I made 5 years ago and which no one really ever looks at, is fully static. I just dropped mp4 files on my server, along with the other files and embedded them through HTML5's regular media tags. The whole thing gets served through apache. Works like a charm.

The only reason it would need to get more complicated than that, in my mind, is if you're serving largish amounts of traffic.

This is similar to my approach to serving videos of me reading a few of my poems to my poetry website. It works mainly because nobody wants to watch me read my poems. I do worry about what would happen if one of those poems went viral - I couldn't afford additional costs from my webhost.
Mh, I think you should clarify you target:

- if the target is making money than you are tied to very popular platforms, because it's only there the largest public (unfortunately);

- if the target is a selected audience you already know and they equally know you a feed publishing just new video URLs and files just dropped in a webserver suffice, you users only need to click the link to see, no web-crapplications nor WebVM (improperly named and known as browsers for legacy reasons) needed;

- if the target is personal nothing beat a storage media in your pocket...

I have NO idea of how media or video works. So I'm just going to post this here in case someone knows better and helps me understand.

I guess you could just upload all your videos to S3 and serve them over cloudfront. But Video seems to be tricky because there's the whole idea of encoding, adapting quality (detecting a poor connection and serving a low quality video, etc).

What I chose some time ago was Mux, they had a very good and developer friendly service.

AFAIK, the only two good options these days are MPEG Dash (fMP4), or HLS.

Bento4 has tools for manipulating the containers depending on your needs, and its not difficult to setup, though you most likely will need to have a certificate and hosting infrastructure setup to allow the player to load the video (i.e. CORS).

Upload your high resolution MP4 to S3, and open it to public only allow them to download.

To mimic what Youtube is doing, then yes you will need to transcode it to streamable chunk, in multiple bit rate, and then storage them. Assuming you are not applying your own DRM here.

As you can see, this is rather storage intensive and there aren't any free solution on this.

[flagged]
Not feeling offended by pornography titles like "i was raped ..." is quiet hard, honestly.

I have no issues with pornography itself, but that's extreme trigger material.

It's not real title.. the content provider intentionally made it dramatic
(comment deleted)
Yes, to fantasize about raping someone.

Do you not understand what the word offensive means?

Actual rape would've been straight up illegal with real consequences, including to the platform provider.

I use Azure Storage + BunnyCDN...

Pretty cheap/easy.

Just make sure to use the "volume" network as its much cheaper and latency matters far less for video.
Do you count using a cloud provider as hosting your own?

The most basic pipeline for doing it is going to look something like this:

1) Upload the original video to a storage bucket.

2) Have some compute service transcode the video file to create other renditions.

3) Store those renditions in a different storage bucket.

4) Put a CDN service in front of the transcoded renditions.

Get ready for a nice bandwidth bill if anyone actually watches your videos!

Using Cloudflare is one option - sample pricing[0]:

Streaming a library of 500 GB of HD videos over the course of one month with approximately 72,000 minutes of viewing time to a global market.

Total cost: $78.00/month

[0] https://www.cloudflare.com/en-gb/products/cloudflare-stream

Cloudflare seems fairly expensive for on-demand (that is, uploaded ahead of time) video. They list their prices as $1/1000min delivered plus $5/1000min/month stored. I presume transcoding is included in those rates (since I don’t find any other line item).

Translate Bunny’s pricing <https://bunny.net/stream/> to these numbers: $1/200GB delivered (assuming the volume network—the standard network is 2–12× the price, but I would not expect it to be justified) plus $5/500GB/month stored, and transcoding is included in those rates.

Bunny is cheaper to deliver below 26⅔ Mbps, and cheaper to store where the sum of all transcoded forms is below 66⅔ Mbps. This will almost always be cheaper, normally much cheaper. It depends on the content, but your 1080p60 video is almost always under 10Mbps, probably under 5Mbps, not uncommonly well under 2Mbps. Your bill with Bunny will probably be less than a third of your bill with Cloudflare, and for typically more static sorts of content (e.g. programming tutorials), probably less than a tenth.

(I am presuming the products are roughly equivalent. This may or may not be true. I have used neither.)

I should also mention that Cloudflare’s sample pricing uses grossly unrealistic rates: they translate “500 GB of HD videos” into “1,200 minutes of video content”, which means 55 5⁄9 Mbps. “HD” tends to mean 1080p these days, though it does still get used for 720p too. (Some label 1440p and 2160p/4K as HD too, but I’d say they’re beyond it.) I accuse Cloudflare of using a rate that’s around four times too high. They don’t go into detail on their “typical public cloud provider” costs so I don’t know how realistic the rest is, but given how they’ve started with something that makes them look implausibly cheap, I’m not impressed.

I guess their competition is AWS and the public cloud alikes, and pricing is good enough to compete

But yeah, "marketing driven" price

> they translate “500 GB of HD videos” into “1,200 minutes of video content”

Where does it say this? I can't find it.

https://www.cloudflare.com/en-gb/products/cloudflare-stream/

> Streaming a library of 500 GB of HD videos over the course of one month with approximately 72,000 minutes of viewing time to a global market.

> Storage: $6.00 - Storage costs are based on 1,200 minutes of video content at $5 per 1,000 minutes stored.

Ah! I see.

Could this be because they pre-transcode to different bitrates, and have to store each version?

I considered that possibility, but decided the wording is fairly clearly referring to pre-transcoding library size (“500 GB of HD videos”).

On reflection, it’s possible that there was a miscommunication that led to this wording, since if it were the post-transcoding figure it wouldn’t be outlandish for something like VP9/H.264/AV1 at 1080p/720p/480p/360p, though it’d still be on the high side.

Yeah, that's what I'm wondering. They might also just be being conservative with the number of minutes, in case people upload massive bitrate videos.

Genuine question - what would they gain by making the storage low for the amount of video? I can't figure it out.

> Get ready for a nice bandwidth bill if anyone actually watches your videos!

This 100%

I looked into it before and understandably, the badnwidth you can be using up for a relatively small amount of videos is always going to be pretty expensive. It is also not always easy to know in-advance, and do you want to suddenly get a 10x bill or have to cut-off your users when it gets expensive?

If you can afford to charge, then obviously it's different, otherwise YouTube's annoying advertising is paying for you...

This is how we did it at the FT. We looked at on demand HLS or DASH via our CDN as well but this didn't become a requirement during my time there.
1) Okay, but...

2) Why? There are plenty of blogs walking you through how to use FFMPEG to generate multibitrate HLS packages. I get faster than realtime encoding making 5 different bitrates.

2->1) Now you're only storing the highly compressed versions instead of the original (at whatever compression chosen for that)

Hi, yes, I'm doing it on https://tube.jeena.net by using PeerTube. I've been hosting it on a NUC, first in my kitchen in Sweden, then at my parents house in Germany and now I'm in the process to move the NUC to my home office in South Korea. I'm bridging the time by having moved the whole installation to a server hosted by Hetzner, but it's too expensive in my opinion, and the NUC doesn't use so much power and is fast enough. I even made a video about my reasoning: Sustainable Private Cloud Server - Environment and Cost - https://tube.jeena.net/w/tYbrbqBMkexTwXTrjsN14a
I’m not sure if this will help you much, but I followed this tutorial a few weeks ago to build what I believe you’re describing. It uses a MERN stack to build a “YouTube Clone.”

I am in no way affiliated with its this creator.

https://youtu.be/CCF-xV3RSSs

I host very small videos (screen captures of a CLI output, for example, and yes, I know ASCII cinema exists) on some of my web sites, and never had any major issues with them. I manually encode the video into webm and av1, and then serve the files via a CDN. I did not want to get into the complexity of serving adaptive and different bit-rates because the videos were just small ones. Handbrake can do a good job.

I'd just go with a video tag, containing the webm/av1/mp4 URLs, a poster image, and optionally subtitle tracks.

The first and most important thing is that you need to make sure your web server can serve ranged requests. Most web servers that serve static content should do fine, such as Apache and Nginx. If you have your own web server, make sure they respect Range headers and respond with the requested chunks. Most CDNs do, but servers provided by runtimes don't, such as the PHP built-in server. This is important for the browser to properly preload and seek videos embed.

I find third party video players unnecessary and added bloat. Several years ago, sure, that was when we had to fiddle with Flash players and all browser compatibility shenanigans. A standard HTML5 video player works great, it even hooks into Android media controls, bluetooth play/pause buttons, and picture-in-picture. Though I have not tried, none of the custom players can properly add subtitles/closed-captions to videos and make them work in Picture-in-Picture, apart from the standardized CC tracks. IIRC, Firefox had to bend over backwards and add custom workarounds to get Netflix CC to work in PiP. If it comes to that you need to use a custom player for consistency, I can highly vouch for Media Element JS.

>If you have your own web server, make sure they respect Range headers and respond with the requested chunks.

This is a pro on the HLS/DASH type of content. Even if the server doesn't respect ranges, this is still covered by the segment based encoding of HLS/DASH. Instead of asking the server to give a specified portion of a file, the playlists just requests a specific segment.

I live in an area with symmetrical internet, so I host my own videos for mainly one reason (perhaps I am doing it wrong, but hey): I was uploading class videos during the pandemic. Youtube was taking so long to transcode, that by the time it was ready the class date had passed. I literally gave up trying to upload a 50min video. I am not going to beat up on youtube, but I followed the directions and it just did not seem to work.

Hosting my own is/was not too bad. The students had to wait a little longer. I did not hear too many complaints (really thought I would have heard a lot more "why can I not watch this on my youtube app on my phone").

Did not put too much effort into this post-semester, but I still do wonder what the heck other people do. I consider myself a serious veteran IT person, it is my (accidental) profession for decades. I have no idea how people upload 50+ min videos to youtube. I think I left one transcoding for 48 hours. It was not 50% done. I ensured I was using a codec youtube wanted, and even tried more. Ah well.

On the flip side, hosting on your own, you miss out on CDN reach and breadth and POPs that will cache for you. You will also dramatically miss out on speed. Then, if you have more than a few, what about indexing and search-ability? I do not like "big-corp" internet any more than the rest of us, I guess, but they have the infrastructure that we just do not have. A few videos for a class during a pandemic is one thing... but I would ask what your long term goal is in terms of the number of videos. This might change your mind as to how you want to distribute them.

Haven't tried 50+ mins, but 10/20 mins usually done in 1/2 hours including HD transcoding?

I guess self hosting is good enough for you!

Currently self-hosting a PeerTube video as a backup for my Twitch VODs, maybe as a backup for the eventual YouTube account that I might have to make.

Even with low end hardware (e.g. 200 GEs as homelab servers, with 1 CPU core allotted to transcoding) generally transcoding is faster than the video itself. E.g. 2 hour videos will take less than 2 hours to transcode (1080p, 30fps, going from a bitrate of 7000 to closer to 3500 using H264). On an unrelated note, buying a Seagate HDD is way cheaper than buying that storage "in the cloud", as long as you have backups figured out.

Using my desktop (even kdenlive with CPU encoding, on an old Ryzen 5 1600, 6 cores and 12 threads), it happens even faster than that, albeit it's nice to be able to drag a video file into PeerTube and have it be automatically transcoded to both 1080p, 720p and 480p, for various devices/connection speeds.

I tested out VP8 (libre) a while ago but it was still somehow slower to encode and had larger file sizes than H264. I guess YouTube just doesn't give you as many resources given the large volume of videos that it needs to deal with.

In case anyone is interested:

Kdenlive: https://kdenlive.org/en/

PeerTube: https://joinpeertube.org/

I have a few sites I use AWS Elastic Transcoder to upload the videos to S3 and put CloudFront in front of it.

It works amazing. No ads. No third-party tracking. BUT it is not the cheapest solution. I have one site where there is an auto-play 5 minute HD video on the homepage and it costs $70 a month for just that video. But that's an extreme case, other lower traffic videos are very low cost (< $0.10 / month).

Obviously my workflow is very AWS centric. You could also successfully replace Elastic Transcoder with something like FFMPEG if you are open to doing more work to automate.

Still, you may want to consider one of the services optimized for video as they tend to offer lower cost and have transcoding built in.

To all the people saying to use Nginx or similar: you can do that. I strongly recommend putting a CDN in front of it, though. Because with video buffering a small change in latency can have a big effect and the CDN will make sure the video is served from geographically close edges.

> I have one site where there is an auto-play 5 minute HD video on the homepage and it costs $70 a month for just that video.

Are you serving the whole video file to every visitor? You might want to try using Cloudfront’s streaming support if you’re not already using it: https://docs.aws.amazon.com/AmazonCloudFront/latest/Develope...

I should have included more context.

The average visitor downloads about half the video (based on the bandwidth usage stats). Unfortunately because of the nature of the page people tend to linger.

That page gets a million+ hits a month and it's already using adaptive bitrate and resolution. Which the pipeline I mentioned can support.

It's just a bad design IMO but I haven't been able to convince them to change it since the client believes (and may be right) that the video increases their sales enough per month to be worth it.

It's all about your use case. If they were monetizing that video they would only need a penny per view to make a profit.

If you’re looking to self-host and are comfortable using AWS, I wrote a quick guide on the best way to self-host videos with the same performance as YouTube: https://neil.gg/2020/07/20/diy-video-streaming/

I’ve used the same technique to host various videos over the years with zero issues, but the s3 charges can add up if you’re not careful since you’re storing multiple copies of the same video to enable adaptive streams.