P
P
pojarcky2020-10-25 10:07:31
Canvas
pojarcky, 2020-10-25 10:07:31

Problem when capturing via ffmpeg script on node.js. Or what capture tools can help?

Good day to all! I want to immediately apologize for the longread, but there is no other way to describe the question.
There is a task, to write a master script for recording broadcasts with a chat on a game resource, so that the output is a whole mkv / webm file.

Over time, in terms of logic, several options were worked out:
1) It all started with the idea that it was possible to capture the m3u8 video stream of the broadcast itself. Render chat data through canvas, capture it, and then post-render to combine it into one file. The first VPS on which the load fell was the Gino host with two unknown cores of 2 GHz and 4 GB of RAM, as a result, the following picture:
5f951e59c3cff074857823.jpegAnd this is when capturing one stream, and there can be up to 4 of them. 25 ideally 30.

It was decided to switch to VPS from Xeon on the REGRU site, because the information about the CPU of the first hoster is unknown, they were sinned. On Xeon 2.2GHz, the situation changed a little for the better, but the desired result was not achieved even for one broadcast.
2) And at this moment, the second hypothesis was worked out, to take the browser into headless and capture it with FFmpeg, but even with this option, the load turned out to be too large.
5f9520011fd0b018134842.jpeg

There was a feeling that the VPS simply did not have enough video memory to process video.
The transition to a VPS with 256MB of video memory on a server with a GPU was made.
But here, too, a fiasco awaited during the test.
5f9521e41e6cc148118628.jpeg
5f9521edee312291767124.jpeg
Plus a response from 1Gbru hoster support:
"what you want won't work on the type of gpu provided in the service you're taking"

Now the essence of the question, maybe someone faced a similar problem when capturing video or can suggest a more suitable tool? And perhaps someone even knows about the unaccounted for specifics of what is happening.
Because there are just the most extreme options in the spirit of taking a PC with an i5, GTX960 and turning it into a server.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question