Hello! I've read your previous threads and understand the pain you've faced or are about to face. As the owner of a large LIive and VOD video streaming service with over 500,000 unique daily users and more than 10,000 concurrent viewers, I'll give you the key points to pay attention to.
CDN — traffic will devour almost your entire budget. If you have sponsors like advertisers or investors from the start, that's great. Otherwise, expect to go broke after the first few thousand views. Here, you'll immediately run into two issues. But first, a little information:
1 Megabyte (MB) = 8 Megabits (Mbit).
The average bitrate for a 1920x1080 VOD video is about 5 Mbit/s (0.625 MB/s).
The average movie length is 1.5 hours.
The average size of such a movie is 3.3 GB.
So, first: to support a large number of concurrent viewers, you need high bandwidth. Cloud services handle this well. Cloud services like Google Cloud, AWS, Azure, Tencent, etc., charge an obscene amount of money for traffic. The average price for traffic is $0.1/GB. Let's say 10,000 people watch one movie. That's a $1,000 expense (10,000 * 0.1). What if more people watch?
Second: you can build a CDN from servers where traffic costs are not metered. Let's say you have 10 such servers, each with a 1 Gbit/s bandwidth. The cost of one such server would be around $15/month. That's $150/month in total. These 10 servers will work well as long as you have a small number of concurrent viewers.
Let's do the math:
10 * 1 Gbit/s = 10 Gbit/s
10 Gbit/s = 10,000 Mbit/s
10,000 / 5 = 2,000 concurrent viewers.
As soon as you have more viewers on your site, the bandwidth won't be enough for everyone. Because of this, the site will lag for all users. You'll have to buy new servers. But wait! We haven't included something important in this calculation.
Disk Space — I mentioned earlier that an average movie is 3.3GB. But you'll have much more than that, right? And you'll probably want to support them in different qualities and encodings. Each of these files will take up disk space. Each server will need its own disk to cache the videos. You also need a place to store all the video files, for example, S3 storage. If a required file is not in the cache on one of the servers, it will be fetched from the central storage. You also need a disk for backup storage of all files in case of an emergency—for all videos, all qualities, and all encodings. What is encoding?
Transcoding — another thing you will encounter. Encoding is a method of video compression. If you've ever recorded something with a camera, you've probably noticed large .mov video files. These are the original videos as they were shot. But you shouldn't transfer such large files over the internet. Or anywhere, really; they are just too big. To solve this problem, compression algorithms exist. For internet video, there are mainly three: H.264, H.265 (HEVC), and AV1. These algorithms fit well into containers with file extensions like .mp4, .mkv, .ts, .webm, etc. Why is this important? If you are going to show videos in different qualities, you will have to re-encode your video into one of these codecs.
Almost all devices support the H.264 format. It's nearly everywhere and easy to use. It produces standard file sizes. But it is NOT suitable for 10-bit videos with deep colors or 4K videos.
HEVC is another story. It came after H.264. It compresses video better and can handle deep colors and 4K. But not all devices support it.
Then there's AV1. It has the highest compression. If a standard movie in H.264 encoding is 3.3GB, in AV1 encoding it would be 1GB or less. It also handles 4K video well. But it's not suitable for videos with deep colors.
So what's the problem? The transcoding process itself. This process is very long, and if you don't have a dedicated machine with graphics accelerators, converting one movie into all these encodings could take you a full day or more. Why all encodings? The answer was given above —the smaller the video file, the more people can use the site, or the more money you will save.
What if you just use AV1 for everything? — Oh, I wish. But alas... Not all devices support HEVC. And even fewer support AV1. In the end, you have to make sacrifices. Yes, each video file is an additional expense for disk space. But it will be much cheaper than paying for extra traffic.