HACKER Q&A
📣 worldofmatthew

Anyone hosting their own videos?


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.


  👤 gyulai Accepted Answer ✓
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.


👤 Apreche
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!


👤 readingnews
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.


👤 dewey
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.

👤 viraptor
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.

👤 Ayesh
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.


👤 jeena
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

👤 bullen
I host my own videos, 206 is the HTTP code I implemented in my own web server to get that to work, an example: http://talk.binarytask.com/task?id=4064110776042269443

👤 santiagobasulto
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.


👤 throwaway2016a
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.


👤 bertman
https://fasterthanli.me/videos

This is a nice example imho.


👤 guptaneil
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.


👤 kkfx
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...


👤 seper8
I use Azure Storage + BunnyCDN...

Pretty cheap/easy.


👤 dceddia
Just yesterday I was looking for how to do this too, and came across this article on how to create videos suitable for streaming (there’s even a Python script). https://vincent.bernat.ch/en/blog/2018-self-hosted-videos

👤 hollywood_court
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


👤 nxbp
Just have to nitpick: videos. Plurals don't have an apostrophe.