OpenVidu Recording Performance Tunning

Hello everyone,

i had some issues about multiple recordings on same OpenVidu server.

If multiple recording starting in same moment, the ffmpeg running inside in multiples openvidu-recording container consumes a lot of machine resources (mainly CPU).

I’m trying some tests to optimizing recording process. For example, changing ffmpeg to recordmydesktop:

docker run --rm -d --name ffmpeg openvidu/openvidu-recording:2.9.0
docker exec -it ffmpeg bash
apt update; apt install vim recordmydesktop -y
vim /entrypoint.sh
 ...
 recordmydesktop --on-the-fly-encoding --width 1920 --height 1080 --display :99 -o "/recordings/$VIDEO_ID/$VIDEO_NAME.ogv"
 ...
docker commit ffmpeg openvidu/openvidu-recording:2.9.0
docker stop ffmpeg

Another test, is consuming the dashboard in a dedicated machine for capture:

google-chrome --start-maximized --no-sandbox --test-type --disable-infobars --window-size=$WIDTH,$HEIGHT --window-position=0,0 --no-first-run --ignore-certificate-errors --autoplay-policy=no-user-gesture-required --kiosk $URL

Is there a way to run video recording asynchronous (converting raw video file after, rather than on-the-fly)? Had someone already used another way of video recording with OpenVidu?

Thanks!

Video recording using ffmpeg or a similar software is a very demanding CPU process. You can take a look to the ffmpeg command inside the recording container being used in OpenVidu:

The command options are the ones we found more suitable at that moment. Of course a way of saving CPU would be avoid any type of encoding when recording the media (and do so later in a different process), but in that way the disk space needed grows exponentially (1GB every few seconds).

Those options are the ones we consider most appropriate at the time, but if there is an ffmpeg expert who can improve them in some way, we are open to changing them.

Regards.

2 Likes