M
M
melikbekyan2020-07-01 16:24:09
Nginx
melikbekyan, 2020-07-01 16:24:09

How to set up a server to serve video and audio files?

The task is to make a server for uploading video files (from 500 MB to 7 GB) and audio files for an audience of up to 5 - 10 thousand people. That is, users will actively watch the video. What are the solutions, please advise. I'm thinking of doing it through nginx, but I don't really understand what characteristics are needed for servers, how to properly configure nginx, what formats and codecs to use for video.

UPD What is the best way to organize transmission via HLS protocol or pseudo-streaming? There should be support for rewind.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
SKEPTIC, 2020-07-01
@pro100chel

Basically a lot of options. It all depends on your budget (or the budget of the office where you work)
Take Nginx to serve files.
For 10k people and a video of this size, you need such a sickly infrastructure. In fact, it all comes down to the fact that you need either a CDN, or several servers with a large channel, or a flock of virtual machines.
Let's take a look at each option.
1) CDN - it will be quite expensive for you considering the needs. Traffic on CDNs is not cheap these days. A terabyte can be taken for 1000 rubles - this is the minimum. And so the same Selectel price will be from 2000 rubles per terabyte.
2) Servers. There are different. You can take 1 server with a 20 Gbit channel. But it won't be very smart. Suddenly the server crashes. And in order to distribute 7 GB of video to 10k users, you will need a strong iron.
There is another option. Take several servers with 1 Gbit channel. German quality from Hetzner will help you here. https://ru.hetzner.com/hosting/produkte_rootserver... such a server will cost you 3000-3500 rubles per month. Estimate yourself according to the load and think how many such servers you will need to take. Well, roughly speaking, let's say 20 servers of 1 Gbit each will cost about 60,000 rubles per month. Just keep in mind that the server is not set up for you right away. Now it takes several days. Sometimes a week. Miss the moment and part of your audience will not be able to enjoy watching.
3) Virtual machines. Write your own software or take it ready. The idea is that you can order virtual machines from Hetzner and many other hosts via the API. During peak loads, just a script will buy virtual machines, configure them and load back on them. Payment is hourly. That is, at night you can pay almost nothing. During that day, the script will raise the virtual machines as much as the service needs. https://www.hetzner.com/cloud-ru You are given 20 TB of traffic per virtual machine. The script should look at the traffic and when the arrow reaches 20 TB, the script should cut down new connections to the virtual machine and when the last viewer is cut off, delete the virtual machine.
There are all sorts of different scaleway https://www.scaleway.com/en/virtual-instances/deve...There are already virtual machines with unlimited traffic and the channel will be wider. Oh, and the pay is hourly too.
Something like that. You can combine the second and third options. You can sit on one thing. Again, it all depends on the budget. You can make users share videos with each other. To remove part of the load from the server. Like a P2P network.

A
Armenian Radio, 2020-07-01
@gbg

The first question will be the definition of simultaneous online and, therefore, the channel. And then you wrote here for 10-20 gigabits, as it were.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question