Increase the quality of the recordings

190 views
Skip to first unread message

Daniel Sabin

unread,
Jul 29, 2022, 2:48:23 PM7/29/22
to BigBlueButton-dev
Hello friends, I am bothering you on this occasion to see how I can get freeswitch or whoever is responsible to generate better quality recordings of the sessions. I teach electronics and sometimes it pixelates a lot, despite the fact that I am the only one who uses a camera in the presentation and one managed with OBS Studio to be able to share more than one. or sometimes desk and camera.
Has anyone been able to fix this problem. I appreciate your help.

Fred Dixon

unread,
Jul 29, 2022, 10:18:52 PM7/29/22
to bigblueb...@googlegroups.com
Hi Daniel,

I did a quick search and found this discussed in an earlier thread. 


Let us know if that helps.


Regards,... Fred



On Fri, Jul 29, 2022 at 3:48 PM Daniel Sabin <sabin.danie...@gmail.com> wrote:
Hello friends, I am bothering you on this occasion to see how I can get freeswitch or whoever is responsible to generate better quality recordings of the sessions. I teach electronics and sometimes it pixelates a lot, despite the fact that I am the only one who uses a camera in the presentation and one managed with OBS Studio to be able to share more than one. or sometimes desk and camera.
Has anyone been able to fix this problem. I appreciate your help.

--
You received this message because you are subscribed to the Google Groups "BigBlueButton-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bigbluebutton-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bigbluebutton-dev/33f63cf0-0558-4e59-b1f0-a51d98910906n%40googlegroups.com.


--
BigBlueButton Developer

Like BigBlueButton?  Tweet us at @bigbluebutton

Daniel Sabin

unread,
Jul 30, 2022, 9:37:20 AM7/30/22
to BigBlueButton-dev
Hello Fred, thanks for the answer, I had already read that thread, my problem is that when recording a class the images on the web are of a very good quality in the machine that generates them, esata is an INTEL core I7 24Gb of RAM and video card of 2GB there are no hardware problems.
but the final video if you download it from the platform has low quality I will do a test and see what original video is recorded in /bigluebutton/recording/raw and see what video and quality is uploaded to /bigbluebutton/published/presentations/
I have touched the qualities of the webcam but even so it always records the same video quality.

I just need to raise the quality a bit

Fred Dixon

unread,
Jul 30, 2022, 12:22:04 PM7/30/22
to bigblueb...@googlegroups.com
Hi,

>  I will do a test and see what original video is recorded in /bigluebutton/recording/raw and see what video and quality is uploaded to /bigbluebutton/published/presentations/

I did a quick test of recording a webcam set to quality High.  The 23 second raw file written by Kurento was 1.2M, while the processed file used in the recording was .8M.

In viewing both files, I can see, understandably, a decrease in quality in the output for the recording.

Here is the input file (I renamed it to a.webm)

ffmpeg -i /var/www/bigbluebutton-default/a.webm
Input #0, matroska,webm, from '/var/www/bigbluebutton-default/a.webm':
  Metadata:
    encoder         : GStreamer matroskamux version 1.8.1.1
    creation_time   : 2022-07-30T15:55:54.000000Z
  Duration: 00:00:23.36, start: 0.000000, bitrate: 432 kb/s
    Stream #0:0(eng): Video: vp8, yuv420p(progressive), 640x360, SAR 1:1 DAR 16:9, 15 fps, 15 tbr, 1k tbn, 1k tbc (default)
    Metadata:
      title           : Video


For details, here is the output file created by the recording processing.  The video spans the full 37 seconds of the recording (as it also holds the audio as well).

ffmpeg -i /var/bigbluebutton/published/presentation/6e35e3b2778883f5db637d7a5dba0a427f692e91-1659196533315/video/webcams.webm
Input #0, matroska,webm, from '/var/bigbluebutton/published/presentation/6e35e3b2778883f5db637d7a5dba0a427f692e91-1659196533315/video/webcams.webm':
  Metadata:
    COMPATIBLE_BRANDS: isomiso2avc1mp41
    creation_time   : 2022-07-30T15:56:27.000000Z
    MAJOR_BRAND     : isom
    MINOR_VERSION   : 512
    ENCODER         : Lavf58.29.100
  Duration: 00:00:37.27, start: 0.000000, bitrate: 185 kb/s
    Stream #0:0: Video: vp9 (Profile 0), yuv420p(tv), 640x480, SAR 1:1 DAR 4:3, 15 fps, 15 tbr, 1k tbn, 1k tbc (default)
    Metadata:
      HANDLER_NAME    : VideoHandler
      ENCODER         : Lavc58.54.100 libvpx-vp9
      DURATION        : 00:00:37.270000000
    Stream #0:1: Audio: vorbis, 48000 Hz, stereo, fltp
    Metadata:
      ENCODER         : Lavc58.54.100 libvorbis
      DURATION        : 00:00:37.268000000


The difference in quality is likely due to the bitrate 432 kb/s for the original and 185 kb/s for the finished processed video.

Regards,... Fred

Marcel Hellkamp

unread,
Jul 31, 2022, 2:41:01 PM7/31/22
to bigblueb...@googlegroups.com

Hi,

presentation processing is a mess. I'm still not sure if I fully understand it, but from what I have gathered so far it looks like this:

Webcam-videos are stored exactly as they were received by the server. Browsers have to compress in real-time with quite low bit-rate limits and the used network protocol is prone to package loss or network hiccups, so the video quality will always be rather bad compared to a locally recorded video. We cannot do anything about that.  Do not use BBB as a video recording tool if you care about video or audio quality I guess.

After archival (gathering all files and events from all the different components) and some sanity checks, the data is processed into a presentation. A script [1] will (losslessly) remux these videos from flv to mp4 to remove some common defects, then cut and merge the videos based on event data timestams in a checkerboard pattern. This cutting and merging requires re-encoding the video data, even if only a single participant is visible, and the settings used here are really really bad! The quality level (-crf 30) is way worse than the ffmpeg default (23) or the value recommended for lossless encoding (17-18). Lower is better here. 30 would be okay-ish for vp9, but these numbers have a different meaning for the h264 codec used here. The `-preset veryfast` parameter makes this even worse, as it disables a lot of h264 features that would improve quality or reduce bit-rates.

[1] https://github.com/bigbluebutton/bigbluebutton/blob/develop/record-and-playback/core/lib/recordandplayback/edl/video.rb#L27

After that, if you kept vp9 as the default output format and did not switch to mp4, the video is encoded a third time, again with very questionable settings [2]. The `-deadline realtime` parameter forces the vp9 encoder to sacrifice quality to ensure real-time restrictions, even if this is a batch task with no real-time requirements. The `-cpu-used` parameter also has a different meaning in this mode and `-cpu-used 8 -threads 4` will effectively limits CPU usage to 50% of at most 4 cores, no matter how many cores or headroom your server has. The `-crf 32` quality level used here is on the low end for single-pass encoding, but fine. The problem is that this is an upper limit, so for complex scenes or on a low-end or busy server this quality level will never be reached.

The double-encoding with two fundamentally different codecs in low quality also mean that vp9 has to encode the compression artifacts of x264 as if they were part of the original video, increasing the complexity and reducing end result quality even further.

[2] https://github.com/bigbluebutton/bigbluebutton/blob/develop/record-and-playback/core/lib/recordandplayback/generators/video.rb#L60

So, to sum it up: In a default setup the webcam videos are encoded three times (once on the client, twice on the BBB node) with two fundamentally different codecs (h264 and vp9) and exceptionally low quality settings and real-time restrictions on hardware that is supposed to be busy serving BBB, not encoding videos. No wonder the result looks like blocky pixel soup. I do not see a way to fix this without editing BBBs processing libraries and sacrificing more CPU power to video encoding. These is no config option to increase quality (just frame-rate and resolution) and using a separate server to do the video encoding does not seem to be a supported feature. Perhaps this area could use some serious cleanup and re-thinking.

Best, Marcel


Am 29.07.22 um 20:48 schrieb Daniel Sabin:
Hello friends, I am bothering you on this occasion to see how I can get freeswitch or whoever is responsible to generate better quality recordings of the sessions. I teach electronics and sometimes it pixelates a lot, despite the fact that I am the only one who uses a camera in the presentation and one managed with OBS Studio to be able to share more than one. or sometimes desk and camera.
Has anyone been able to fix this problem. I appreciate your help.

Mohammad Kazemi

unread,
Aug 16, 2022, 5:34:37 AM8/16/22
to BigBlueButton-dev
Hi.
I was also thinking about something,
why the video is encoded three times? wouldn't x264 be enough and supported in all browsers these days? I mean, why encoding to vp9 when we have x264 ready?

P.S. I also tried to enable 2-pass encoding. it's much better in quality, but it doesn't work with `-deadline realtime`, and with `-deadline good` the value for `-cpu-used` is limited to 4 or 5, which makes it too slow.
source:
Reply all
Reply to author
Forward
0 new messages